System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraController : MonoBehaviour
{
public Joystick joystick;
private float mouseX;
private float mouseY;
public float sensitivityMouse = 200f;
public Transform Player;
private void Start()
{
//Cursor.lockstate = CursorLockMode.Locked
}
private void Update()
{
mouseX = joystick.Horizontal * sensitivityMouse * Time.deltaTime;
mouseY = joystick.Vertical * sensitivityMouse * Time.deltaTime;
Player.Rotate(mouseX * new Vector3(0, 1, 0));
transform.Rotate(-mouseY * new Vector3(1, 0, 0));
}
}
mathf.clamp
Обсуждают сегодня