我正在学习几个不同的Unity教程,每个教程中游戏对象移动的方式略有不同。
这些方法各有利弊,哪种方式更适合第一人称RPG呢?
// Here I use MovePosition function on the rigid body of this component
Rigidbody.MovePosition(m_Rigidbody.position + movement);
//Here I apply force to the rigid body and am able to choose force mode
Rigidbody.AddForce(15 * Time.deltaTime, 0, 0, ForceMode.VelocityChange);
// Here I directly change a transforms position value, in this case the cam
Transform.transform.position = playerTransform.position + cameraOffset;
谢谢!
编辑:
我注意到的一件事情是,施加的力似乎模仿了轮式车辆,而位置变化则模仿了步行/奔跑。