I have no idea how to set the X axis of the FreekLook Camera in code. Can anyone help?

I’ve been trying to get/set the x axis of the FreeLook Camera so I can set the angle of the camera to the same as a Virtual Camera when transitioning from a Virtual Camera to a FreeLook Camera. That way the camera doesn’t flip back into the opposite direction if the player happened to have left it there before the transition.

I found m_XAxsis but it just adds to the axis rather than setting it. One thing I noticed is that m_YAxis dose exactly what I was trying to do and set’s the value. If I do m_YAxis = 0 in update then it locks Y to 0. However, if I do the same with m_XAxsis then nothing happens. If I do m_YAxis = 1, then the view starts to spin around. In the Axis Control in the Inspector, if I add anything to Y/Value it updates the values and axis in the scene. But If I do the same to X/Value it updates the scene, but the values stays at 0. Is this a bug? Or is it supposed to work like this?

So my questions are:

Is it possible to smoothly transition from a Virtual Camera to a FreeLook Camera while setting the angle to the Virtual Camera, That way it just zooms in and is ready to go?

What’s the best way to set the X axis of FreeLook?

And is m_XAxsis and m_YAxis working as intended?

I’m guessing that you have the FreeLook’s binding mode set to Simple Follow. In that mode, X axis is always 0. If you change it to WorldSpace, it will behave more as you’re expecting.

However, I think there is a simple solution for you. Enable this in your FreeLook:

6827423--793550--upload_2021-2-11_8-16-20.png

1 Like

DUDE, you’re a hero! Both of these will help a ton!

1 Like