- Home /
Losing the gravity physics when stopping
Hi there!!
The project I'm currently working is not my first Unity project but this is the first time I ask anything here. Now I've started working in a ball-labyrinth moved by an accelerometter. The problem is this:
I've developed a provisional way to move the stage with buttons. Those buttons just move the stages rotation.
But the problem is about the ball. When the ball falls into the stage, I can move it properly by rotating the stage, and everything goes okay... unless the ball stops. Once the ball stops seems to lose its physics (if I lift it the ball "floats"), and even the stage breaks through the ball when I move it. For this reason, I must give to the stage an starting tilt of 1 grade, because if I let the ball stops (or start sttoped), my game's over eheheh.
I hope my explanations have been good enough. I would swear that is not any scripting problem because I haven't develop any specific physics script for the ball yet.
Thank you so much in advance,
Alex.
$$anonymous$$ight be related to physics sleeping. Some object go to sleep (i.e. physics is not calculated anymore) when they are not moving. But normally they are awaken upon collision or when forces are applied to them.
I was waiting for an answer... and the answers were already given.
Well, yes, its a 3D stage, filled with colliders, and a Rigidbody in the ball. Sounds that what $$anonymous$$ryptos has explained might be possible.
The point is that I don´t apply any force to the ball. I rotate the stage.
I did one proof: When the ball has already stopped, I sink the stage, manually in the SceneView, and the ball remains in the air, flying. If I lift the ball, ins$$anonymous$$d, the ball "awakes" and falls. ¿What should I do to "awake" the ball? Could be the problem that when I rotate the stage I cut the ball with it?
I would suggest not moving/rotating the stage at all. You can simulate it by rotating the view of the camera and changing the direction of the gravity.
This may prevent the stage from cutting the ball. And I think it will be more stable.
As for the sleeping part, check the documentation.
¡¡I got it!!
Thank you so much, both of you. That was the point, the rigidbody was "sleeping", just a simple WakeUp!! WakeUp!! Uoooo! WakeUp!! WakeUp!! Uoooo000
Well, in any case I will answer your answers: 1) No I didn't. 3) With "cut the ball" I meant to cross the ball with the plane that represents the floor. 4) Could be that "stage" isn't the properly word. Sorry, I'm Spanish and I do the best I know :P. With stage I mean the floor, the walls, and everything that composes the labyrinth.
So, thank you so much. From now on I'll be here to see if my knowledge is enough to help anybody else. ¡Take care!
Yes, I'd love to do that, but I can only mark $$anonymous$$es as answer. And yes, I wonder why the ball falls asleep, but the idea of kryptos links the accelerattor to the gravity and maybe is more complex. I will think on it anyway.
Answer by Kryptos · Oct 16, 2012 at 03:44 PM
Answer was given in comment. Here is a short review.
Might be related to physics sleeping. Some object go to sleep (i.e. physics is not calculated anymore) when they are not moving. But normally they are awaken upon collision or when forces are applied to them.
You can force a rigidbody to awake with Rigidbody.WakeUp. See RigidbodySleeping for more information.
Your answer
![](https://koobas.hobune.stream/wayback/20220613082428im_/https://answers.unity.com/themes/thub/images/avi.jpg)