ANOTHER problem with flipping animations

So, I already know how to flip animations. (I had help solving this here: Problem with flipping animations)

But I have a lot of animations to flip. Like a LOT LOT. I tried to make a function that would flip any animation that you put into it, and it failed :frowning:

Screenshot 2021-12-09 3.45.50 PM

So when the function is called, it also sets the 4 other variables


The animation is an array and the first thing (in this case the animation is called gank spank, I was tired)

The second one is just whatever sprite you want to apply the flipped animation to, and here it’s the player

The third one is just the interval at which the animation plays

and the last one is supposed to determine whether the animation is a loop or not

But when I tested the code, it said that it “cannot read properties of undefined (reading iface)”

I don’t know what iface is or what is undefined. I need help with this, please!

tried it myself. got it to work. just don’t clone the photo (for some reason it didn’t work)

1 Like

I just use the velocity stuff. That’s my best bet. I do that to be safe to avoid these super complex situations. (Just a suggestion)

1 Like

happy birthday drtongue96 :smiley:

but your solution didn’t really work, it kind of just has the same problems as my first post about flipping animations…

It worked. Passed in the animation and it reversed it. What you could do is create a less complicated function to pass in an animation and then in the function itself RETURN the reversed one, then you don’t need all those extra parameters.

well for me, it just flipped it everytime the button was pressed

also what does the return function block do? I never got to figuring that out.