Question by
CrashCZ · May 28 at 04:12 PM ·
cameracamera rotatecamera-look
How to flip Free Look camera upside down
I am working on a game where you can flip gravity and walk on teh ceiling. But I can't figure out how to flip the camera upside down so the player's view looks the same on the floor and the ceiling. I am using cinemachine free look camera.
Comment
Best Answer
Answer by CrashCZ · May 29 at 07:33 PM
Okay, I figured it out myself. I had to make m_State field of CinemachineFreeLook class public and then implement this code
private void Update()
{
if(_isInvertedGravity && FreeLook.m_State.RawOrientation.eulerAngles.z != 180)
FreeLook.m_State.RawOrientation = Quaternion.Euler(FreeLook.m_State.RawOrientation.eulerAngles + new Vector3(0, 0, 180));
}