# Roulette wheel rotation

Discussion in 'Scripting' started by Deepaks, Dec 21, 2010.

1. ### Deepaks

Joined:
Oct 26, 2010
Posts:
11
Hi i am new to unity 3d. I have learnt better about the interfaces in unity. I am developing a casino roulette game for PC.
I am able to rotate the roulette wheel for some seconds and stop it. But i am a bit confused in providing the effects in rotation. Clearly to say, initially the wheel is rotated fast and later the wheel should slow down and stop after some time. I am stuck at this part. Any suggestions and help is agreed. Please help me out to get out of this.

Thanks.

2. ### Jeffom

Joined:
Oct 6, 2010
Posts:
55
well, its just a physics question,
to spin the wheel to have to apply a force ( torque ),
then if the wheel is spinning against a surface it makes a force against it( friction )
that you should be able to equatione in way to you convenience.
or do something like ( not tested ):

if( object.angularvelocity.magnitude > 0 )
\\apply counter force.

3. ### Bongo

Joined:
Jul 24, 2009
Posts:
75
Its also something you could do without physics. Animating the wheel directly in a 3d software package (such as Max or Maya) or handling the rotations specifically using some math are other options (instead of dealing with friction and all that) are two other ways I could think of.

4. ### surbhidhingra

Joined:
Jan 15, 2014
Posts:
2
Hi

The given approach of angular velocity is really helpful, i succeeded in wheel implementation but can anyone direct me how to implement the roulette ball using real physics and colliders in 3d space.

I want to implement something like below in 3d world
http://kamagames.com/roulettist

Any help is appreciated

Thanks

5. ### wandern3D

Joined:
Oct 13, 2013
Posts:
64
Hi,
untested but I wanna build in MAYA or Blender a ROULETTE,
then in the first step I import it into UNITY,
then give this OBJECT a colider like "Concave Collider 1.11"
This tool allows that the ball falls into the small holes in the roulette.

Then Step2 make a funtion to rotate the OBJECT Roulette with
transform.Rotate(0, Input.GetAxis("button_XYZ") * RotationSpeed * Time.deltaTime, 0);

At this time you can see how the ball react with your object.
Set DRAG and AngleDrag to good values.

The last step is to figure out how you can see in which hole the ball falls.

Hope this helps a bit...

6. ### CG_Artist

Joined:
Apr 28, 2017
Posts:
3
Hi
Is it possible to make a predefined bet with a realistic way ?
any ideas how to approach that ?