Change AIM/BODY of FreeLook in runtime

Hello! I need help with changing aim or body at component FreeLook through script. I found no answers in other topics…
8660673--1166193--upload_2022-12-14_11-23-53.png

8660673--1166193--upload_2022-12-14_11-23-53.png

It’s not standard practice to be changing these things by script. Usually, in order to change the behaviour, you make a second FreeLook with the new settings and activate it, which causes the CMBrain to make a smooth blend. If you change programmatically, there will be a pop.

Assuming that you don’t care about the pop, the way to do it is to access the 3 rigs and change the behaviours in there, e.g. freeLook.GetRig(0).SetCinemachineComponent() etc.

You can see examples of similar code in the Scripting sample scene that comes with Cinemachine.

Note: you can only change the Aim this way. Changing the body will probably result in a crash.

Hello! Thank you for quick response.
It is a pity that there is no possibility of changing Aim through script.

Thanks for the advice, I’ll try to play around with two cameras.

You CAN change the Aim through script.