How to toggle animation?

Hi,

I just update my project from 4.18 to 4.21 and I notice that the method “Override Animation Data” no longer works as previously.
I’m trying to flip flop an animation (played forward the first time and played in reverse the second, using negative play rate) but the second animation is nerver played.

Is there a better way to do it ? Or a different behaviour than the 4.18 ?

Thanks in advance

Is the bottom branch even being executed? Try checking with a print node or something. If it’s not, the problem isn’t your Override Animation Data node, the problem is the branch condition.

Thanks for your answer.
The first time it’s launched, the condition is false, then the animation is played (forward) but when I redo the operation, it correcly go to the other branch and execute all methods except the “Overrride animation data”… I don’t realy understand

Well, I have no experience with the Override Animation Data node, but according to its documentation page (linked before), its Position parameter is expected to be a Float, and not a Vector.

I’m not sure, but I think Position refers to the point (in time) where you want the animation to begin playing. I have no idea what feeding a 3D vector would do.

I can’t say whether anything changed from 4.18, but maybe this will spark some ideas for how you can fix your issue.

Override Animation Data node is the node I have found for playing animation from a specific position and can revert it.
The given position parameter is not a vector but the “state” of the animation (from start equals 0 and at the end 0.83333).

(Note : this issue is not in a construct script)
In my blueprint, I’m trying to play the animation in the other direction even if the first is not completed, it does a playback animation.
I can’t found the cause of this issue, but I really appreciate your help (not used to ask for help on forums)

Gotcha! Not sure how I got so confused. Vectors are usually referred to as ‘Locations’ anyway. The name ‘Get Position’ should have clued me in that it’s a float value. Thanks for setting me straight.

Anyway, I’m really guessing beyond my experience at this point, but are you sure the Override Animation Data node is the best choice for your use case? It seems like that node is used for customizing animations on subclasses (overriding the parent class’s default animation behavior). Is that what you need it for? Or are you simply trying to play an animation with precise control?

If you don’t actually need to override a parent class’s default animation behavior, maybe you should try swapping in some combination of the Play Animation node, the Set Play Rate node, and the Set Position node.

Last note: based on the other answers I’m finding related to this topic, it seems like you might benefit from learning about (and implementing) Animation Montages. Apparently it makes dealing with animations a lot simpler and more powerful, once you get everything set up. Just thought it worth mentioning, in case you aren’t very familiar with that system (like me).

Yes ! Thank you the_batch !
Indeed, it was the Play Animation, Set Play Rate, and Set Position nodes combination that make it works. My mistake was to don’t understand which animation is gonna be played. I had to set the Animation mode of the mesh to Animation Asset and pick up the Anim to Play. I was too much focus on the BP logic…

So, here is the solution for those, like me, who search obstinately the solution in the blueprint :

266391-component.png

But I still don’t understand why my BP worked in 4.18 and no longer in 4.21.