- Home /
Question by
CarpeLudus · Jul 30, 2015 at 06:31 PM ·
2drotation
2d Rotation Animation C# help
I am new to Unity and I want to rotate a 2d sprite. I have gotten the object to rotate however, it is a snap rotation as opposed to going through a rotation animation to its specific angle. How do I fix this?
using UnityEngine;
using System.Collections;
public class BottomRightRotation : MonoBehaviour {
public GameObject wheel;
public void OnMouseDown () {
wheel.transform.Rotate (0, 0, 144);
}
void Update() {
OnMouseDown ();
}
}
Comment
You should multiply 144 with Time.deltaTime to get a smooth rotaion, independent of the FPS
Your answer
Follow this Question
Related Questions
Side scroller - rotate object towards player. 1 Answer
Start Coroutine after other has finished 4 Answers
Random smooth rotation on z-axis every other second 2 Answers
2D Animation does not start 1 Answer