Unity3d - 向Space.World转

时间:2017-03-22 08:57:16

标签: unity3d rotation position

我希望您将立方体转到目标角度。但是,随着你将转向各个角度," Space.World"很困惑。我如何整合" Space.World"进入" RotateToward"功能

我需要使用" localPosition&为:eulerAngles"在代码?

等:

targetRotate = new Vector3(0,180,0);
transform.rotation = Quaternion.RotateTowards (getRotate (), Quaternion.Euler (targetRotate), rotateTime * Time.deltaTime);

Code in Gist

0 个答案:

没有答案