Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Mouse_Camera_Movement
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Mouse_Camera_Movement : MonoBehaviour
{

public float speedH = 2.0f;
public float speedV = 2.0f;

private float yaw = 0.0f;
private float pitch = 0.0f;

// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
yaw = yaw + speedH * Input.GetAxis("Mouse X");
pitch = pitch - speedV * Input.GetAxis("Mouse Y");

transform.eulerAngles = new Vector3(pitch, yaw, 0.0f);
}
}