Я делаю 3D-игру и хочу, чтобы моя камера вращалась с помощью джойстика.В моей игре есть контроллер от первого лица, движение которого уже контролируется левым джойстиком, и я хочу, чтобы основная камера вращалась с правым джойстиком.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour
{
CharacterController cc;
public Joystick joystick;
// Start is called before the first frame update
void Start()
{
cc = GetComponent<CharacterController>();
}
// Update is called once per frame
void Update()
{
float xInput = joystick.Horizontal;
float zInput = joystick.Vertical;
cc.Move(new Vector3(xInput, 0, zInput));
}
}