5

我找不到如何根据英雄的速率和高度不断地动态混合 3 个摄像机(我称它们为中、上和下)。

跟随英雄时,中间的 vCam 是主要/基础的,我想根据英雄的高度按比例混合上下 vCam。

玩家/英雄可以在不同高度之间快速移动,因此应该轻松地对混合进行加权。这是 Cinemachine 混合的自然组成部分。并且有效。但对我来说,这就像一个开关,以我目前对 Cinemachine 混合的理解,而不是基于高度的恒定动态混合。

4

2 回答 2

4

您可以考虑移除上下摄像头并仅使用中间摄像头进行自己的“手动混合”。最近我一直在使用 Cinemachine,我做了一些与您想要的结果类似的事情。

由于我不完全知道您希望您的相机如何表现,因此我向您展示了我所做的一些手动混合,解释说:

//Camera Direction
//If I´m not in ground, and I've been on the air for a specific time
if (!onGround && timeSinceLastJump > cameraDelay)
{
   //Moves the offset of the camera down to the maximum allowed y offset (In your case it would be where the lower camera is)
    if (vcam.GetCinemachineComponent<CinemachineTransposer>().m_FollowOffset.y >= maxYOffset)
        vcam.GetCinemachineComponent<CinemachineTransposer>().m_FollowOffset.y -= offsetYSensivity;
    //It also zooms out up to a specified level
    if (vcam.m_Lens.OrthographicSize < maxFOV)
        vcam.m_Lens.OrthographicSize += camSensivity;
}
else
{
    //Same but upwards
    if (vcam.GetCinemachineComponent<CinemachineTransposer>().m_FollowOffset.y <= minYOffset)
        vcam.GetCinemachineComponent<CinemachineTransposer>().m_FollowOffset.y += offsetYSensivity;
    //Same but zooming in
    if (vcam.m_Lens.OrthographicSize > minFOV)
        vcam.m_Lens.OrthographicSize -= camSensivity;
}

通过这种方式,您可以在条件下使用您的玩家身高,但代价是必须设计好相机逻辑。

也许这可以帮助你以某种方式做你想做的事。

于 2019-05-20T10:50:26.903 回答
-2

据我所知,您可以在 Cinemachine 混合选项中定义混合样式。从描述来看,当您可能想要类似于 EaseIn/EaseOut 的东西时,它似乎设置为“Cut”。如果默认选项不适合您,它甚至允许您定义自己的相机之间的自定义混合。

查看文档以获取更多详细信息。

于 2019-05-17T10:36:51.700 回答