Search Unity

  1. Going to #UniteBerlin? Bring a buddy & get 25% off the 2nd ticket! More info here.
    Dismiss Notice
  2. Famed game designer and creator of The Sims, SimCIty, and Spore is looking for a 3D artist to join their team. Join the challenge.
    Dismiss Notice
  3. Unity 2017.4 has arrived! Read about it here.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. We've opened a new World Building sub-forum to faciltate all your world building discussions! Drop in and ask any ProBuilder, ProGrids, or PolyBrush questions.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Roulette wheel rotation

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

  1. Deepaks

    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

    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

    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

    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

    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...