Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

How do I fix this?

$
0
0
I'm trying to attach a script to my main camera. The error message says that it can't attach the script component because no script class could be found. Ik this will sound stupid, but I don't know what the script class is, and how to check it, but I followed a tutorial exactly, and it didn't work And here's the script: using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerCam : MonoBehaviour { public float sensX; public float sensY; public Transform orientation; float xRotation; float yRotation; private void Start() { Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; } private void Update() { float mouseX = Input.GetAxisRaw("Mouse X") * Time.deltaTime * sensX; float mouseY = Input.GetAxisRaw("Mouse Y") * Time.deltaTime * sensY; yRotation += mouseX; xRotation -= mouseY; xRotation = Mathf.Clamp(xRotation, -90f, 90f); transform.rotation = Quaternion.Euler(xRotation, yRotation, 0); orientation.rotation = Quaternion.Euler(0, yRotation, 0); } } And my main camera is named Main Camera, and the tag is Main Camera. My script is named Main_Camera. I don't know why it won't work to attach.

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>