Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Rotating objects in increments with swipe.

Discussion in 'iOS and tvOS' started by therobear, Aug 4, 2012.

  1. therobear

    therobear

    Joined:
    Sep 28, 2010
    Posts:
    22
    Hello,

    Forgive me if this question has been asked before. I am trying to rotate an object with swipe. If the swipe is going up in the y direction, the object will rotate in 90 degrees increments clockwise. If the swipe is going down in the y direction, the object will rotate in 90 degree increments counter clockwise. I have the swiping down, but what i have trouble doing is telling it which direction to go to. I have tried using Mathf.MoveTowards angle, but that just rotates the object to point at 90 degrees or -90 degrees. I do not want to use slerp or lerp because i dont want the rotation to slow down towards the end of its rotation. I would normally look at the Unify Community first, but since it's down, I thought I would come here and ask. Any help is greatly appreciated.

    Thanks!
     
unityunity