CounterOfDefeat @CounterOfDefeat
Joined over 4 years ago
GMR
HaHa Old Roblox Goes using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraLook : MonoBehaviour
{
public float mouseSensitivity = 80f;
public Transform playerBody;
float xRotation = 0;
void Start()
{
Cursor.lockState = CursorLookMode.Locked;
}
void Update()
{
float mouseX = input.GetAxis("Mouse X")*mouseSensitivity * Time.deltaTime;
float mouseY = input.GetAxis("Mouse Y") * mouseSensitivity * Time.deltaTime;
xRotation += mouseY;
xRotation = Mathf.Clamp(xRotation, -90f,90f);
transform.localRotation = Quaternion.Euler(xRotation, 0, 0);
playerBody.Rotate(Vector3.up * mouseX);
}

This user hasn't posted anything yet.
