Different Animation Movement (2D Side Scroller)

Hey all,

I’m attempting to make a small fighting game in UE4. I used the 2D Side Scroller as a template for my game. I’m attemping to use Blueprint Scripting to enable a different animation for when the Player 1 character is moving left, but I just can’t figure out how to do it. Originally, the character would mirror when traveling in the opposite direction.

Now, whenever I attempt to move left, the flipbook animation just sits on the first frame and doesn’t animate the rest. Any fixes for this?

I’m only on a mobile right now but take a look at video 3 or 4 of this playlist. He’s doing this for a braid clone.

I hope this helps.

Cheers

Just post a picture of your blueprint setup
(alt+print screen when you have your focus on your blueprint ) and we will fix it for you ! :slight_smile:

I’ll post a picture soon. Sorry for duplicate questions as well that got posted. There was an error last night and I tried submitting the question a few times.

Pic posted!

Are you referring to this?

I am almost certain you don’t have your character (the component which contains the flipbook) inside of your controller.

You will have to set the rotation of your character. :wink:

No not really.

In this BP you do nothing regarding the rotation.

You could do two things. Change the sprite rotation or change the actor rotation. Doing the latter one allows you to tie the movement to the rotation as well but it really doesn’t matter. You can also change the character rotation and still do the movement independently.

You try to change the control rotation. However you want to change the actor rotation of your character or the rotation of your sprite.

Set control rotation only changes the rotation of your controller. Not the actor and therefore not your sprite.

I’m not trying to rotate the sprite/actor. I want the sprite to face the same direction, but when I move left on the Y axis, there is a “backing up” animation. I hope we’re communicating the same idea. Like I said, I’m new and struggling. The issue is, the full animation doesn’t play. It stays stuck on one frame and moves to the left.

Oh my god I’m so sorry.

Mirrored says for me simply the other way around.

I see now. It does make perfect sense how it works now. You call your “update animation” each tick which sets a flipbook.
Then you also call back move which sets a different flipbook.

Since this happens each frame it will always only display he first frame. The flipbook will continue if the same is set again but if you change it, it will start again from the beginning.

Just put your “update animation” right behind your upper “set control rotation” and it should work like a charm :smiley:

That worked! I’m starting to understand a little better how the system works, thank you. The only issue I have now is, now that’s it reading just those frames, it never stops to check if the character isn’t moving and so the Idle Animation never gets played. Any fixes for that?

Well you use the axis event.

It’s not event tick but will only trigger if an axis event happens.

This means if you do not move it will not call “update animation” or “back move”. So it’s impossible that you have no velocity when calling thise which means you will not play the Isle animation.

Yeah, this Axis Event has been giving me a lot of trouble. I wish I could just have a separate event for moving backward on the Y axis, but I can’t find anything.

Are there any other simple alternatives for calling these animations while I’m moving?

Watch the series I posted in my initial answer.

He solved animation and movement really nicely.

Awesome. Thank you.