Camera Quick Turn

rechnight

New member
Hello, hope you all are having good times during the holidays!

I have a question, I'm using the 3rd Person Combat view and really would like to implement a quick turn (press a button, player turns 180 degrees). I'd like to know how I can make the camera follow the 180 motion along with the animation. I have to confess, I don't know much of coding, if there's a way I can achieve this through states or something like that would be great!

As of now, I added a generic ability that on the press of a button turns the player 180 degrees, but since the camera doesn't follow, the player turns back as soon as the animation ends. Would love to know if there's a way to achieve this.

Thanks!
 
Unfortunately there's nothing built-in to the abilities inspector by default that can move/rotate the character like this. But it's simple enough to manually rotate the character - you can use the UltimateCharacterLocomotion.SetRotation method to forcefully set the character's rotation to a desired value. So you could have a custom ability that gets activated which would disable player input and whilst it's running set the character's rotation every tick to rotate towards its destination. E.g.:

C#:
m_CharacterLocomotion.SetRotation(Quaternion.Euler(transform.eulerAngles + (Vector3.up)));

In an ability, this would rotate the character 1 degree to the right.

This page may be of help with regards to creating a custom ability, but let us know if you need any more help with that.
 
Top