when i try to do a rotate script do my skin its do to my an error and dont working **its for camera controllers** using System.Collections; using System.Collections.Generic; using UnityEngine; public class CameraControllers : MonoBehaviour { [SerializeField] private float mouseSensitivity; private Transform parent; private void start() { parent = transform.parent; Cursor.lockState = CursorLockMode.Locked; } private void Update() { Rotate(); } private void Rotate() { float mouseX = Input.GetAxis("Mouse X") * mouseSensitivity * Time.deltaTime; parent.Rotate(Vector3.up, mouseX); } }
This is actually not helpful. How to report your problem productively in the Unity3D forums: http://plbm.com/?p=220 How to understand compiler and other errors and even fix them yourself: https://forum.unity.com/threads/ass...3-syntax-error-expected.1039702/#post-6730855 If you post a code snippet, ALWAYS USE CODE TAGS: How to use code tags: https://forum.unity.com/threads/using-code-tags-properly.143875/ Also, consider this:
Everything @Kurt-Dekker said is true. However, as I was scrolling down, I did see at a glance a glaring issue. Methods should always start with a capital letter. Get in this habit. Especially when they are one of Unity's magic methods. start() should be Start()
This ^^^ Start() and start() are different method names. So the error you're getting is likely a null reference error inside the Rotate method because start() is never run to set "parent".