Search Unity

How Can I Do Rotation with Good Gameplay?

Discussion in 'Scripting' started by mbyapim, Nov 15, 2019.

  1. mbyapim

    mbyapim

    Joined:
    Aug 26, 2019
    Posts:
    8
    I want to rotate a cylinder with touchs. DeltaPosition.x is bigger than 0 then it will rotate. I did it like this:

    deg -= 150f * Time.deltaTime;
    transform.eulerAngles = new Vector3(0, 0, deg);

    Is there any better way?
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    What do you mean by "better"? If you want it to feel more natural, you probably want to use DeltaPosition.x directly (in this case not including a Time.deltaTime multiplier), as that will feel more 1-to-1 with the user's movements which usually feels better.

    Beyond that, you'll have to more clearly define what you mean by "good gameplay" and "better way".