Unity. Inspector references to objects disappear after restarting the scene
The bug occurs in two cases. 1) When I restart the scene. 2) When I go to another scene and then come back. The game works correctly only after the first start of the scene.
Camera y Axle dont rotating
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerMovement : MonoBehaviour { public float speed = 10.0f; public float gravity = -9.81f; public float jumpHeight = 3.0f; public float mouseSensitivity = 100.0f; public Transform playerBody; private CharacterController controller; private Vector3 velocity; private float xRotation = 0f; void Start() { controller = GetComponent<CharacterController>(); Cursor.lockState = CursorLockMode.Locked; […]