We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e5c31c commit 29414a5Copy full SHA for 29414a5
Assets/Samples/RebindingUI/Game/Player.cs
@@ -251,7 +251,12 @@ private void FixedUpdate()
251
var y = move.y;
252
if (y < 0.0f)
253
y *= 0.33f;
254
- if (m_Rigidbody.linearVelocity.magnitude < 10.0f)
+ #if UNITY_6000_0_OR_NEWER
255
+ var velocityMagnitude = m_Rigidbody.linearVelocity.magnitude;
256
+ #else
257
+ var velocityMagnitude = m_Rigidbody.velocity.magnitude;
258
+ #endif
259
+ if (velocityMagnitude < 10.0f)
260
m_Rigidbody.AddRelativeForce(Vector3.up * (10.0f * y) + Vector3.right * (5.0f * move.x), ForceMode.Acceleration);
261
}
262
0 commit comments