- Home /
Question by
RolfBertram-com · Feb 10, 2011 at 06:52 PM ·
gravityballstuck
Rolling ball gets stuck in corners
I'm moving a ball on a flat surface, limited by stretched cubes, by changing the direction of gravity. Works nicely, except, when the ball ends up in a corner, it's stuck. It seem that once the ball reaches velocity = 0, it's stuck forever. Here's the gravity code:
function FixedUpdate() { xAngle = Input.acceleration.x; yAngle = Input.acceleration.y;
Physics.gravity = Vector3(-yAngle*10,-10,xAngle*10);
}
Comment
Best Answer
Answer by RolfBertram-com · May 03, 2011 at 11:06 AM
Got it. The ball falls asleep and can be kept awake by adding a force, even if the force is zero Rigidbody.AddForce.
I confirm, still is true. Just check if you are not adding a zero force. Unity 5.3.5f1