- Home /
Ball Get Stuck on Rotating Platform
Hi There! more n00b Questions here... I'm doing a simple Roll-A-Ball Game for my daughter, but instead of applying force to the ball, I rotate the platfrom, making the ball move because of gravity. The set up at the moment is a flattened Cube that acts as floor, and a Ball (The Player)...
My main issue, is when i start the game, if i don't move the floor quickly, when the ball collides, it get's stuck and the floor rotates and overlaps the player, ignoring colliders...
As you can see in the attached images, the ball has a rigid body and should act under the laws of gravity, but on the example image, the floor is rotated but the ball doesn't fall...
Any Ideas on what may be causing this? Thanks!!!
[1]: /storage/temp/34173-example1.png
The ball has the basic config: 1 mass, 0 drag, uses gravity, not kinematic nor constrained in any way... going to try robertu's tips and chexk if that fixes the issue...
No problem, I noticed you have given this info in your screen shot after :S If you are still having any problems let us know :)
Answer by robertbu · Oct 23, 2014 at 04:23 PM
One possibility is that it is sleeping.
http://docs.unity3d.com/Manual/RigidbodiesOverview.html
If so, you can put this in a script in FixedUpdate() on the ball:
if (rigidbody.IsSleeping() ) {
rigidbody.WakeUp();
}
While not a complete solution, consider also setting rigidbody.sleepVelocity and rigidbody.sleepAngularVelocity to 0.0.
If you have not already done so, consider assigning a physic material to the ball and surface colliders. Not a specific fix for your problem, but it might make the surfaces behave more like you envision.
Thanks!!! Your Solution fixed the issue... the Ball was in fact sleeping... I forgot to add the script, so it didn't show the sleeping debug.log so i thought it wasn't sleeping... (the materials didn't help though)...