I am new to unity and i am making a roulette game. I am able to rotate and stop the roulette wheel but how do i determine the number on which the ball finally stops after the wheel stops rotating. I am betting on a number in the betting table and spinning the wheel. After the roulette wheel has stopped spinning how to determine that the number which i bet is same as the one on which the ball stops. Please give me some suggestions. Any help is treated greatly.
You can do it two ways. One is easy, the other… I’m sure it’s easy but I don’t know the calculation.
Create a triangle slice in your modelling program and place it on each of the roulettes slices. Add mesh collider to the model and then use scripts to determine which slice the ball sits in.
Slice = The black and red things on the roulette table, no idea what else to call them.
Get the angle between the center point of your roulette table and your ball and figure out where it sits
You just gotta make sure the returned angle is a value between 0 and 360… I remember when I’ve used it before that you gotta do something extra, can’t remember what it is.
How did you make the ball?
Even a Unity 3d sphere component with rigidbody would look minimally realistic.
If you tweak its colliders and gravity settings a bit.
Check out the roll a ball project.
I know the concept is different, where a player controls the ball with the keyboard. But, it shows you how to make a ball and make use colliders, and such to detect which number it hit.
I have 3D model of ball. Designer make it. So I just have problem to trow ball realistic in wheel. If I use AddForce method it doesn’t make round circles like I want.