Answers for "how to change rotation depends on mouse move in unity"

C#
0

how to change rotation depends on mouse move in unity

var speed : float = 1.0; //how fast the object should rotate
 
  function Update(){
       transform.Rotate(new Vector3(-Input.GetAxis("Mouse Y"), Input.GetAxis("Mouse X"), 0) * Time.deltaTime * speed);
  }
Posted by: Guest on August-06-2021

C# Answers by Framework

Browse Popular Code Answers by Language