viewers access
public void Player.PlayerController.SetCameraRotation(Vector3 vec)
CyberPsychosis > Player > PlayerController > SetCameraRotation
Rotates the camera by the vector vec
Different from SetRotation(), which overrides the rotation. instead RotateCamera() will add to the euler angles
using UnityEngine;
using Player;
public class CameraMover : MonoBehaviour
{
public PlayerController player;
public Vector3 targetEuler;
void Update()
{
Quaternion targetRot = Quaternion.Euler(targetEuler);
Quaternion currentRot = player.cameraObject.transform.Rotation;
// Lerps the camera to look to the target euler
player.SetCameraRotation(Quaternion.Slerp(currentRot, targetRot, Time.deltaTime));
}
}