- Home /
Rigidbody loses speed
I have a Rigidbody, a ball, that has no Drag or Friction at all. It's launched at the beginning of the script and shouldn't lose any speed. I have a mesh collider, a paddle, that bounces the ball another way. If the collider is perfectly paralleled and still the ball doesn't lose any speed, the way I intended it. But if the paddle is slightly crooked and the ball hits a sloped surface, the ball loses speed. Is there any way to prevent this?
have you looked at the settings of your Physic-$$anonymous$$aterials ?
Also, PhysX simulates actual real-life physics. It's hard to say what "should" happen with zero-drag situations. You'd be imparting spin, probably, so it would slow down.
'ave you actually check the velocity before and after using rigidbody.velocity.magnitude
Then let me reformulate; "How can I have my rigidbody move at constant speed in the direction that is calculated by unity's physics engine?"
Answer by Fattie · Nov 02, 2012 at 01:59 PM
As I already said:
Have you actually check the velocity before and after using rigidbody.velocity.magnitude ?
Use Debug.Log to tell you the two speeds. Let us know the two speeds.
IF they truly change, simply SET the speed after the bounce.
Do so simply using
rigidbody.velocity = rigidbody.velocity.normalized * YourDesiredSpeed;
that's it !