I am attempting to create a Peggle clone in Unity, and I am struggling with the bounces being inconsistent.
The blue line is made with a PhysicsScene2D and shows exactly how the ball will bounce, and I found that some very specific angles cause the ball to not bounce, as shown in the video.
The ball’s Rigidbody2D is set to continuous dynamic and I have set the Velocity Threshold to 0.0001, so I don’t think those are problems.
Does anyone know what is causing this issue and how to resolve it?
Without more information, it’s impossible to say exactly what it is.
What are the collision normals of the contact here? What is the “Fever Meter” composed off collider-wise? Is it a continuous surface (edges) or a bunch of boxes side-by-side etc? Maybe you’re hitting a corner of one of those boxes, assuming that’s what’s there.
You could merge them all together using a CompositeCollider2D in outline mode to produce a continuous surface assuming this is the issue.
Make sure you have max slipperyness on too (PhysicMaterial2Ds on all the colliders)… if you have any friction then impacts may involve torque, either increasing or decreasing the ball’s angular velocity, either of which would affect its ultimate reflection angle.
Update: It was a piece of code that was kind of messed up, basically doing the same thing as the velocity threshold.
Now I’m off to fix the polygon colliders being unsmooth
1 Like