[我正在使用Unity创建游戏,其中玩家不得不使用wasd一次将玩家移动1个图块(3D),我希望当按下其中一个键时,使玩家随着移动而顺畅地旋转。在下图中看到。我尝试了无数种方法,但是如果您能帮助我,似乎仍然无法使它奏效。
捆绑有利于从一个位置平稳移动到另一位置,您可以从此处重构代码并调用
void update() { if (Input.GetKey("w")) { //begin lerp up } //program same for asd }
https://docs.unity3d.com/ScriptReference/Vector3.Lerp.html