- Home /
Sphere Force when falling
I'm instantiating a ball in the air and when it falls to the ground it bounces and everything I need it to do except after the 2nd bounce the ball starts to move on an angle. Is there any way to prevent this from happening after the ball bounces?
Answer by ryanmillerca · Jul 18, 2019 at 08:41 PM
You could freeze the rigidbody constraints to FreezePositionX and FreezePositionZ. That way it won't be allowed to move in those directions. You could freeze rotation as well, if all you want is a bounce.
That is a good solution but the thing is that I need the object to move around in those positions; I just need the ball to immediately stay in place if it is a perfect drop down
You could script it so that upon collision with the ground the constraints become active. Happy to make a code example if you like!