Erioifpuderio.hashnode.dev·Mar 27, 2024Unity 跳跃学习笔记在 Unity 中实现跳跃的方式有多种,我整理了三种可行的方式,在这里分享一下。 Transform 关键代码为: public float jumpHeight = 2f; transform.position = new Vector3(transform.position.x, transform.position.y + jumpHeight, 0); 也就是直接修改物体的位置,说实话,单这一行根本算不上是跳跃,应该是瞬移。 所以要实现 y 坐标的渐进变化,应该用缓动函数来计算位置,线...unityAdd a thoughtful commentNo comments yetBe the first to start the conversation.