Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to toggle animation ?


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.

alt text

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

Thanks in advance

Product Version: UE 4.21
animation.png (95.4 kB)
more ▼

asked Jan 23 '19 at 04:16 PM in Blueprint Scripting

avatar image

1 1 3

avatar image the_batch Jan 23 '19 at 07:40 PM

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.

avatar image MadPumpkin Jan 23 '19 at 08:44 PM

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

avatar image the_batch Jan 23 '19 at 09:00 PM

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.

avatar image MadPumpkin Jan 23 '19 at 10:23 PM

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). alt text (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)

getposition.png (27.8 kB)
avatar image the_batch Jan 23 '19 at 11:59 PM

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).

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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 : alt text alt text

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

component.png (12.9 kB)
bp.png (152.8 kB)
more ▼

answered Jan 24 '19 at 08:58 AM

avatar image

1 1 3

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question