Ball sitting ina hole - Mind Teaser Game

Hi All,

Like many others this is my first post and first game in unity. I am trying to achieve a ball rolling into a hole and when I tilt the board it roles out again.

I have the ball and board and hole set up but I am unclear how to set the ball (or hole) so that when the ball roles over the hole it sits in the hole and when there is enough tilt ( in this case force on the ball) it roles out again.

Any clarification for the direction i need to take would be helpful.

Stephen:smile:

You could just use Physics to achieve that making the ball a RigidBody and setting the Mass / drag accordingly?
Alternately you could snap the ball to the hole when it is in range od the hole, and depending on how you are tilting the platform you could make an if statement which looks the the local rotation of the platform, when the platform is rotated in XYZ a certain amount the ball becomes un-parented.

You can put a trigger over the hole and when the ball enters the trigger set it to isKinematic = true
When you tilt the board just make the ball isKinematic = false

You’ll probably want to snap the ball to the middle of the hole when it enters the trigger as well to make it look like it’s sitting in the hole and be consistent each time you do it