📜  unity 如何获取对象的侧向速度 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:22.494000             🧑  作者: Mango

代码示例1
Rigidbody rb = GetComponent();
Vector3 worldVelocity = rb.velocity;
Vector3 localVelocity = transform.InverseTransformVector(worldVelocity);
//This gives velocity in all directions sideways is on the x axis the thread gives more info