Programming Blog

This blog is about technical and programming questions and there solutions. I also cover programs that were asked in various interviews, it will help you to crack the coding round of various interviews

Monday, 31 July 2017

C sharp code to rotate a component in Unity 3D

                    -----------------C# Code-----------------


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class rotation : MonoBehaviour {
void Update ()
{
transform.Rotate (new Vector3 (x,y,z) * Time.deltaTime * 2);
}
}

/*x,y,z are angles for example x=45y=45z=90*/

No comments:

Post a Comment