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 ?
asked Apr 20 '17 at 05:24 PM in Blueprint Scripting
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.
answered Apr 21 '17 at 09:46 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here