您的位置:首页 > 其它

如何围绕某一轴(不是xyz)旋转——transform.RotateAround

2017-10-31 01:41 801 查看
Rotate是围绕轴来旋转,在正交模式下,呈现水平直线,如何实现围绕设定旋转?需要用到RotateAround方法。

首先设定轴:public GameObject axis;

public float rotateSpeed;

然后在update中,加入一行代码:this.transform.RotateAround (axis.transform.position, axis.transform.up,rotateSpeed);  

注意:然而效果是物体垂直于轴旋转的!

参考原文:http://www.cnblogs.com/hehaiyang/p/4333841.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: