0

我建立台球游戏,我想在游戏中使用 Cinemachine,我的跟随目标是球杆,我看着球杆目标,当我处于当我向后和向前移动球杆以击中母球的状态时,我不希望相机跟踪提示的运动,所以我做了什么,我覆盖了 vcam 的原始位置,我将相机设置为跟随 vcam 位置本身而不是提示,因此相机不跟踪提示并且它的工作正常,问题是什么时候我处于将球杆移动到母球周围的状态我需要相机来跟踪球杆,但只能在球杆的本地 x 轴上,而不是在球杆的另一个轴上(不跟踪球杆的前后 atc )所以我怎么能做到这一点?

protected override void PostPipelineStageCallback(CinemachineVirtualCameraBase vcam, 
        CinemachineCore.Stage stage, ref CameraState state, float deltaTime)
{
    if (enabled && stage == CinemachineCore.Stage.Body)
    {
        //when im in the state when the cue goes back and forward to hit the cueball

        state.RawPosition = transform.position;//override the follow target and simply freez vcam position  

        //when im in the state when the cue rotate around the cueball and i need to follow only after cue x local axis

       // state.RawPosition=///????
    }
}
4

0 回答 0