Search Unity

How can I make a rotating handle that the player can drag to rotate ?

Discussion in 'Scripting' started by Cloviren, Mar 4, 2015.

  1. Cloviren

    Cloviren

    Joined:
    Mar 4, 2015
    Posts:
    3
    Hi guys , I currenctly suck with this . I'm having a wheel with a handle , I want the players to be able to touch and drag the handle in clockwise motion to rotate the entire wheels and when the players drag the handle counter clockwise , the wheel will stuck and won't rotate back .
    Here's some images if you don't understand .



    Thanks so much :)
     
  2. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    Once the player is in dragging mode, have the doorknob rotate to look at the target vector


    you'll need to zerto out one of the axes.
    if your door is going to be moving, you'll need to use local space somewhere in there too.