- Home /
Bouncing ball getting stuck on edge of collider
I currently have a bunch of 2D balls, dots really, bouncing around the screen. They're 2D rigidbodies with no drag or gravity and a very bouncy physics material. When they're spawned they have some forced added in a random direction, which will pretty much be constant, since there's no drag. There's an Edge Collider around the edge of the camera.
My problem is that when the balls hit one of the edge at a very low angle, it'll begin to move along the edge of the collider and not bouncing away like it should. To better explain my problem, please see this gif or this picture.
What can I do to prevent this?
Answer by TobLoef · Apr 27, 2015 at 01:30 AM
What I ended up doing was decreasing the Velocity Threshold, inside Edit -> Project Settings -> Physics2D, thanks to an answer on this thread from the forums.
Answer by YesNoKonrad · Apr 26, 2015 at 12:38 PM
Hey TobLoef,
The way you describe your problem, i am pretty certain you will find your answer, if you go to Physics2D settings. Start in your menubar at the top.
Edit -> Project Settings -> Physics2D
There you will find a lot of things, which will generally help make the game perform they way you expect it to.
The entry you are specifically searching for in this case is called in english Max Angular Correction.
Sadly the explanation to those values is very cryptical and I plan to do some background readings in regard to those. Tell me if I was correct with my assumption. :)
Cordialement, K.
Thanks for the answer. It turns it I had to decrease the Velocity Threshold, as someone said in a thread on the Unity Forums. I appreciate the answer though, it would surely have helped me if I hadn't found the solution.
Answer by zederis · Aug 31, 2015 at 09:02 PM
Velocity Threshold worked for me too. i had the same problem but just one ball. i reduced it from 1 to 0.0001 (thats the lowest you can get to).
Answer by CrossGamers · Oct 17, 2016 at 07:24 AM
i m facing same problem mentioned in .gif how to resolve it, in 3D i had done, but how to do same in 2D?
Your answer
Follow this Question
Related Questions
Sucking a zero-gravity ship into a black hole. 1 Answer
How to simulate physics material 2D bounce without collision? 0 Answers
ex2d with physics ? 1 Answer
Physics2D Overlapbox not working as aspected 0 Answers
Limiting Physics to X and Y 5 Answers