Reset FreeLook Camera - Forward while in AttackCamera Mode

Here is a quick way to reset the previous position and rotation of your FreeLook camera once you enter TargetingCamera. Here’s how it looks

In your FreeLookCamera settings, you will need to change theses

We need a reference to our FreeLookCamera in PlayerStateMachine.cs like this (drag your freelook camera in the inspector to link it)

[field:SerializeField] public CinemachineFreeLook FreeLookCamera { get; private set; }

Then all we need to do is enable the Recentering when we enter the Targeting state (Enter Function) like this

 stateMachine.FreeLookCamera.m_RecenterToTargetHeading.m_enabled = true;
    

And Disable the Recentering when we enter the FreeLook state like this

 stateMachine.FreeLookCamera.m_RecenterToTargetHeading.m_enabled = false;
    

Don’t forget to add using Cinemachine; in all 3 places.

1 Like

You mean in target mode not attack mode yeah ? :]

but this looks good thanks for this

i actually followed nathan combat polish video and added some yaw damping and it looks great

Yes, Targeting Camera. Thanks for pointing that out. I’ve updated the post. Glad you fixed it !

yeah its looking much better now im doing some clean ups thinking if to move back to rigidbody movement before going to AI stuff :]

Thanks for everything

1 Like

@ babi6k Did you use pro builder to build your scene or did you get from an asset in the asset store? I had to build my own as I could not find one that I liked. I really like the looks of yours, Maybe a combo of what you have and what I have. But I do like the way yours is set up better.

i used some asset i dont remember the name of some Character controller that come with some prototype level i liked

1 Like

Privacy & Terms