The basic idea is balancing a ball on a platform.
I have a platform which has a cube collider, which I can rotate.
Also I have a ball on this platform with a sphere collider and a rigidbody.
I can rotate the platfom to balance the ball. All works well so far.
But I would also like the ball to be able to be able to bounce on the platform as well as roll around on it.
The trouble is when I create a physics material and set bounciness of the ball or the platform >0 then when I rotate the plane, the ball passes through the platform (before slowly rising out of it).
I have frictions of ball and platform all set to 0.1. I have sleep threshold set to 0 and bounce threshold set to 0.1. Collision detection on ball set to “continous dynamic”.
Has anyone come across this before? If so, is there a solution to set the physics settings?
The only solution I have so far is just to turn off the bounciness to zero which is not great.
I think I’ll just implement the bouncing through scripting.
Have you tried changing the physics solver type to Temporal Gauss Seidel?
Have you tried increasing the default solver and velocity iterations?
1 Like
I am observing the same problem. I have created 12 balls to experiment with all possible variations of collision detection and interpolation type, and tried various settings for the physics solver and default solver and velocity iterations, as suggested by AITheSlacker above. The balls continue to fall through the modified cube which serves as the platform, whenever I change the cube’s rotation as they roll towards the edge. I also tried various collision settings for the platform.
Perhaps this is a limitation of my system? I am new to Unity. Could someone please explain?
EDIT:
-Using Unity 2020.2.6f1
-Consulted this page:Unity - Scripting API: Rigidbody.collisionDetectionMode
What I have done so far is this:
Set bounciness to 0.
Write a script to detect collisions OnCollision etc. And then reflect the velocity vector when it collides. Works so far.
Another problem I have is that when I rotate one of the platforms too fast the ball goes through it. I think it only happens with convex meshes and not if the platform is a simple cube.
My fix for this I will try is to just overlap some cube colliders in the convex mesh to try and stop the ball going through.
Basically just trying to hack my way though this.