Search Unity

  1. Tune in to get all the latest Unity news live from Berlin on June 19, 6pm CEST. Set up a YouTube reminder!
    Dismiss Notice
  2. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  3. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. 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
  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...
     
  6. CG_Artist

    CG_Artist

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