Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity 3d camera rotate up and down

public class CamRot : MonoBehaviour
{
    public float rotationSpeed = 50;

    void Update()
    {
        Vector3 rotation = transform.eulerAngles;

        rotation.x -= Input.GetAxis("Mouse Y") * rotationSpeed * Time.deltaTime;

        transform.eulerAngles = rotation;
    }
}
 
PREVIOUS NEXT
Tagged: #unity #camera #rotate
ADD COMMENT
Topic
Name
9+2 =