- Home /
Rigidbody2D zeroing component of low velocity values
I'm having an odd issue with colliding rb
Can anyone help?
To set the scene: I'm making breakout clone; the ball bounces from bondary walls when it collides with them except when the incident angle is very small (ie. with a small value for rb.velocity.x)
For example: when the velocity vector of the ball is (-0.5, 5) as it hits the wall, the x component is zeroed after the collision - it becomes (0, 5) - killing the lateral movement of the ball, so it just appears to slide up the wall. But this doens't happen if the x component of the velocity is larger - so a ball with velocity (-2.5, 5) bounces off the wall perfectly fine.
Really weird bug.
The thing that is frustrating is that the zeroing happens, or appears to happen, before OnCollision is called (I've added a watch in VS and the x component gets zeroed before the trace reached OnCollision, which I understand is called after the collicion is handled by the engine) so it feels like it isn't my code that is at fault.
Does anyone know of cases where unity engine zeros out the normal component of colliding rigid bodies where the angle of incidence is small?
Answer by unity_0GlwZ4j_Ggr0lA · Apr 04 at 12:33 PM
Found the solution: in Edit->ProjectSettings->Physics2d The velocity threshold is 1, which means that all impacts below that speed don't bounce
set it to something smaller
Your answer

Follow this Question
Related Questions
Player can't move on a surface that is moving up fast. 0 Answers
How to constrain 2D objects? 2 Answers
How to freeze all enemy objects at once 1 Answer
Incorrect velocity after collision 1 Answer
How do I collide a Kinematic sprite ? 0 Answers