【发布时间】:2015-12-29 10:28:40
【问题描述】:
我正在使用 Unity3D 创建一个程序,其中玩家向目标发射箭。确保箭头以取决于其运动角度的旋转在空中飞行的最佳方法是什么? (即箭头向上向上,向下向下)
我查看了 transform.LookAt 和 Quaternion.lookRotation 函数,但现在确定如何应用它们。这是指示箭头速度的代码:
newArrow.GetComponent<Rigidbody>().velocity = new Vector3 (5*(transform.position.x - mousePos.x), 10*(transform.position.y - mousePos.y), 0);
【问题讨论】:
标签: unity3d trigonometry gameobject