How can I reset my player rotation correctly ?

Hi there,

Here is my problem : I’m trying to build a cover system from the TwinStick Shooter tutorial epic provide. The fact is that my character is rotating when he’s getting in cover, but it can’t reset to the normal rotation, even if I sore a variable with the default rotation at the moment the game is playing.

The process to do that : I’m launching a trace, that return me the cover the character will use. Then, I get the rotation of this cover, and make a Lerp(rotator) to have a smooth transition between the default rotation and the cover’s rotation, so that the character has the same rotation. And finally, when I’m leaving the cover, I’m trying to reset the character rotation to the “Default” one. But… its not working at all.

Here are some screenshots of the game and the Blueprint I’m using to do this :

Sorry for the long post …
Thx,

Dusaral

If you use AI for driving your pawn you should try: “Set Focus”, “Clear Focus”, “Get Focal Point”.
I decided to add pawn AI (and give it direct basic orders) as middle man for controlling pawn, all problems of transitioning between anims, adding idle etc are already solved by Epic. Driving player pawn trough AI is so much less messy.

Well I think I’ve found another solution.
The problem seems to come from the fact that I was storing my Default Rotation variable from the event begin play … Which wasn’t really stored !
Since the moment I moved the setting of this variable to an input fired, it worked …

Anyway, Thx Nawrot :wink: