У нас вы можете посмотреть бесплатно How to make a spectator/free camera in Unity! Quick & Easy! или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Thanks for watching :) script: public float sensitivity; public float slowSpeed; public float normalSpeed; public float sprintSpeed; float currentSpeed; void Update() { if(Input.GetMouseButton(1)) //if we are holding right click { Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; Movement(); Rotation(); } else { Cursor.visible = true; Cursor.lockState = CursorLockMode.None; } } public void Rotation() { Vector3 mouseInput = new Vector3(-Input.GetAxis("Mouse Y"), Input.GetAxis("Mouse X"), 0); transform.Rotate(mouseInput * sensitivity); Vector3 eulerRotation = transform.rotation.eulerAngles; transform.rotation = Quaternion.Euler(eulerRotation.x, eulerRotation.y, 0); } public void Movement() { Vector3 input = new Vector3(Input.GetAxis("Horizontal"), 0f, Input.GetAxis("Vertical")); if(Input.GetKey(KeyCode.LeftShift)) { currentSpeed = sprintSpeed; } else if(Input.GetKey(KeyCode.LeftAlt)) { currentSpeed = slowSpeed; } else { currentSpeed = normalSpeed; } transform.Translate(input * currentSpeed * Time.deltaTime); }