Just added a hit flipbook for my character. Following the paper 2d tutorial. For some reason after the Add Force is applied the first frame of the animation is flipped then goes as normal after that. Any idea of why this could be happening?
After debugging, it looks like this only happens when the Add Force is applied.
If you kept the ‘Event Tick’ nodes that were part of the UE4 sidescroller template player character, the answer you are looking for is here:
This determines the control rotation by using the actor’s velocity, setting control rotation around the Z axis accordingly:
For example, if the player moves the character to the right (generating velocity in that direction), the character’s sprite appears to face in that direction. Similarly, if an applied force moves the character to the right, the same happens. This is why your ‘flipping’ happens.
What you want to do just before the force is applied is set the Bool for ‘UseControllerRotationYaw’ to FALSE, and then set it back to TRUE whenever you need it (on landing, for example).
Seen here is a function that locks ALL controller rotations when force is added, or unlocks it, based on a passed boolean reference: