Swimming movement input - unwanted rotation

EDIT 2 for the sake of clarity:

This might work for you:

No problem, glad it worked!

So I have a character that can swim through water. I’m using a physics volume and checking the “water volume” option to accomplish this. Part of the game’s control scheme is the ability to move up and down with certain keys - swimming directly upward and downward that is.

Basically, the issue is that every time the player swims directly up and down, the character rotates to face the east. I never noticed this until recently and realized it could pose a problem later on since the player in my game is able to fire projectiles based on the direction they are facing. The problem only occurs if no other keys or movement input is given. It’s only if the player presses only the swim up or down button.

Below is a segment of the blueprints I’m using, and this was the only thing I added to the default Third Person Blueprint when testing it on 4.23. I already tried messing around with a few options having to do with orienting the player character in the character movement options, but there was no noticeable effect. I also tried to store the player’s rotation in a variable and update it after the add movement input node, but that didn’t work either. Any suggestions?

Steps to recreate

  • Create a new third person blueprint
    project
  • Add a physics volume
  • Check the “water volume” option on
    the physics volume.
  • Add the blueprints to the third
    person BP shown below.
  • Run the game.
  • Move into the water volume.
  • Press button assigned with the Swim
    Up axis without touching any other
    input.

Expected:

  • The character remains oriented in the
    direction it is currently.

What happens instead:

  • The character always orients east.

My current project is running on version 4.21, but I also tested to see if this issue occurs in the latest version of UE4 on a clean project, and it does.

This worked perfectly! It didn’t occur to me to use Get Actor Forward Vector. Thanks for the help!