C
C#2y ago
Paddy

error CS0111: Type 'MouseLook' already defines a member called 'Update' with the same parameter type

I was following a tutorial in Unity (I'm new) and made a script. The script was working perfectly as intended and I don't know what I did but now it's not working. "error CS0111: Type 'MouseLook' already defines a member called 'Update' with the same parameter type". Pls help im noob using System.Collections; using System.Collections.Generic; using UnityEngine; public class MouseLook : MonoBehaviour { public float mouseSensitivity = 100f; public Transform playerBody; float xRotation = 0f; // Start is called before the first frame update void Start() { Cursor.lockState =CursorLockMode.Locked; Cursor.visible = false; } // Update is called once per frame 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, 0f, 0f); playerBody.Rotate(Vector3.up * mouseX); } }
2 Replies
Paddy
PaddyOP2y ago
nvm fixed it i just had to change the public class sorry for wasting time and space
sibber
sibber2y ago
no worries
Want results from more Discord servers?
Add your server