0

https://github.com/JuppOtto/Google-Cardboard/blob/master/Autowalk.cs

是朝着相反的方向前进,有时会朝着正确的方向前进。?

帮我解决它以朝着正确的方向前进

这是涉及的代码:

CharacterController controller = GetComponent<CharacterController>(); 
moveDirection = transform.TransformDirection(Camera.main.GetComponent<StereoController>().Head.c‌​amera.transform.position);
if (controller.isGrounded)
{ 
    moveDirection *= speed; 
} 
controller.Move(moveDirectionspeed * Time.deltaTime);

运动总是在相反的方向。

现在我厌倦了增加负方向的速度,现在它正在移动,但它被从左边拉了我一无所知。

4

0 回答 0