Rotate a game object around other Unity | Rotate Arount unity| Learn unity | Unity rotation
Channel:
Subscribers:
1,110
Published on ● Video Link: https://www.youtube.com/watch?v=2y9t5SitxTs
In this video I have shown how to rotate a gameobject around other in unity
Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RotateAround : MonoBehaviour {
public Transform target;
public float rotateSpeed=2f;
void Update(){
transform.RotateAround(target.position, Vector3.up, rotateSpeed* Time.deltaTime);
}
}