Walk Backwards

Hi Unrealers,
I’m sure many of have played games like Mortal Kombat, Street Fighter, Tekken. I am trying to get my character to move backwards and always facing the opponent in Blueprint. Any suggestions?
Please, help me with a step by step guide. I have many theory ideas but couldn’t implement any of them.

Best wishes

Which part exactly do you have issues with?

There is a really easy way to always face your opponent. The node is called “Get look at rotation”. You place it in your character, input the current location of your enemy and get the rotation you are looking for. Just use that to “Set” your actor rotation and you’re already good to go on this part.

For the movement itself it’s a bit more difficult. You will also need some work done on the camera to move accordingly but both of those things really depend on what exactly you want to create.

…in general however I would suggest to not start with a fighting game as it’s rather complex and difficult to create compared to a basic fps or twinstick shooter or something like that. Create one of those, play a little with the movement and then come back to this project and it’ll seem a lot easier and actually doable! :wink:

Erasio gave me great feedback. With his help I got the player to face each other and turn if they happen to cross each other. Now the only problem left is the that the player is making “moon walk” when walking backwards. Erasio did instruct me on how to make it work but unfortunately I couldn’t make it work. If anyone has a snap shot showing how to get the player do backwards walk animation would be extremely helpful.
this is what I have so far

I think you want to decouple character rotation from movement. Open your character blueprint defaults and uncheck: Orient Rotation to Movement.

Now when your character is facing left and moves right, he will do so without changing his facing direction. Your animation blueprint will detect that its walking backwards and use the correct animation.

well, that’s already done but animBP didn’t detect anything. probably needs to setup something there to let it know when to play the backwards animation, right?

I played with nodes and got it working. I have absolutely no idea what I did, nor how it worked but thought I should share it anyway if anyone can explain it. The only problem with it the character walks very slow backwards. I dig more and see if I can fix it.



At the moment trying to get the camera right in the center of the two characters. It keeps shifting towards player1 and player2 ends up out of the frame. Any ideas?

OK, the problem was the upper corners in the blendspace. I shouldn’t have backward animation there. As soon as I removed them it works perfectly now :slight_smile:

Hey Raed I know this is a little late but I’m also having problems with the character facing each other blueprint. Im using Find Look at Rotation node connected to Set Actor Rotation. But I dont know what to put for the start and target vectors.
I tried Get Player Character (index 0) -> Get Actor Location -> and this is plugged into the Start socket of “Find Look at Rotation”
and also Get Player Character (index 1) -> Get Actor Location -> set to target in “find look at rotation” and the value of that is plugged into Set actor location but this doesnt seem to work.

Er… you would happen to still have that picture, would you? I have the same problem six years later.

oh man… that’s a long time ago. Are you talking characters facing each others at all times?
I don’t have the old one but I made a new for you
I get a reference to the other character (not the best way to do it but I wanted to get the idea across)

Then you set the rotation on the yaw axis

Yes, for walking backward. For some reason that is the only animation that will not fire during play (although it works fine in the Blendspace setup)

Did you setup a direction variable in your AnimBP?

Yes I did.

hmmm… because my only assumption is that the Direction value isn’t correct. The AnimBP isn’t getting direction value based on where the character is looking. I can’t think of anything else but if anything comes to my mind I’ll update you

Did you ever solve this issue, I’m currently working on getting my Ai Character to move backwards if hes focusing on my player and retreating. I have a Eqs and hes a ranged character… he moves away if the player character is getting close to him. But he is playing his run animation… how would i get him to play a backwards animation?

Still at it. For me the player alternates between strafing right and left.

Alright, lets see if we can this working for you. I was able to get it working as intended for my Ai Enemy Behavior Tree and AnimBp, the logic should work for you as well.

  1. Make sure you are using blendspace, and not blendspace 1D. You will need speed and direction. Now add that blendspace into your locomotion, it will ask you for speed and direction variables. Below I will show you the logic to define those.

  2. Logic for direction and speed, which you will implement in your animation blueprint event graph.

  3. The 3rd step is to implement a set focus in your Ai logic,

For me I am implementing this in my behavior tasks blueprints,and calling it as a task… This should work, if your get this to work… make sure to make another task to clear focus once the character is done killing/or losing line of sight.
Let me know if this worked or you need more help. I was stuck for days so I know how it feels.