How To Make An Object Rotate In Unity 2D | Unity Tutorial
Learn how to make an object rotate in Unity 2D with this concise guide. The tutorial covers two main methods: adjusting the Transform component directly for simple rotation and using C# scripting to achieve dynamic, programmable rotation. Whether you're looking to add smooth spinning effects or rotate objects in response to player input, this guide provides clear, step-by-step instructions to help you enhance your 2D game with engaging rotation effects.
WATCH FULL TUTORIAL ON YOUTUBE
=========================================================
Unity Projects - ON SALE!!!
1. Water Sort Puzzle 9000 Levels
2. Ball Sort Puzzle 9000 Levels
3. Sling Shot
=========================================================
Script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Rotation2D : MonoBehaviour
{
public float speed = 500;
// Use this for initialization
void Update () {
transform.Rotate (new Vector3 (0, 0, Time.deltaTime * speed));
}
}