Character rotation resets (wasd movement and rotation)

so i have this problem where i want my char to move and rotate with wasd. the char moves and rotates correctly. it looks like this

BUT! the rotation resets everytime i stop to move.
can someone pls help ?

The problem you have is that you are setting the rotation of the actor depending on the input every tick, if you have some input then the rotation is being set to the direction you calculated but when you stop that input resets to 0 (MoveForward and MoveRight) and the calculation to get the move direction will return 0.

So to fix this issue I suggest that you don’t do this on the Tick function but rather get a callback from the input events, so that every time you press the key you set the rotation and the movement of the player.

Hope this helps, you can also take a look at one of the templates from Unreal, like the 3rd person and open up the PlayerCharacter blueprint.

the failure was “useControllerRotationYaw” what seems to reset the rotation to zero. but you are right i was thinking it would be something like that but i can use inputaxis events too just like you said.
thanks anyways. :slight_smile: