x

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 do I setup an animation to be triggered, then loop until triggered again?

Really struggling with this. UE4's animation pipeline is horribly convoluted for simple stuff, IMHO.

Basically:

I have a skeletal mesh, with some rigid bodies moving around. I have two animation clips - an intro clip, and a loop. I need to play the intro via a triggering event (be it a keypress, onBeginPlay etc etc), then continue to loop until the even is re-triggered.

How would I go about doing this?

Product Version: Not Selected
Tags:
more ▼

asked Apr 30 '14 at 11:47 AM in Using UE4

avatar image

scrcr0
283 15 17 31

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

There are a few ways to achieve this I think. Here's some ideas:

  1. With an animation Montage. There's built-in functionality in Montage to have looping and non-looping sections and you have the ability via Blueprint to jump to a specific section in a Montage. Detailed info here: LINK.

  2. With a bit of logic in an AnimBP state machine. You could have a looping state and a non-looping intro state that can transition back and forth between one another. The transition from the intro to the looping state could be fired whenever the intro anim ends, and the transition from the looping anim back to the intro could be fired by your triggering event. More info on state machines and how they work: LINK.

  3. Lastly, if your skelMesh doesn't have an AnimBP, you can set the Animation Mode in your Skeletal Mesh Component to 'Use Animation Asset' (then slotting in your looping anim). Like so:

alt text

Then, control the logic of switching back and forth between your intro and looping anims in the mesh's corresponding EventGraph (dragging off of the skeletal mesh and using nodes like 'Play Animation'). As an animator, this is probably not the method that I would go with because there's a lot of functionality built into Montages and State Machines that you won't be able to take advantage of here.

Good luck!

more ▼

answered May 01 '14 at 01:10 PM

avatar image

Ray Arnett STAFF
1.4k 45 17 71

avatar image TorQueMoD Apr 05 '16 at 06:37 PM

I'm having a similar issue using anim sequences triggered in the level blueprint rather than a montage. I plan to create a full AnimBP later but for prototyping purposes, triggering anim sequences in the level bp is a lot easier. My issue is that on one trigger, I set the animation of the character to play a cinematic, then when the cinematic finishes, I set a looping animation. Then when the player walks through the next trigger, I set a new looping animation. The problem is that this new looping animation doesn't loop. It seems to be overridden by the previously set looping animation so when it finishes playing once, it jumps back to the last looping animation.

To make this more clear the animations are "greeting", "endloop" and "idleloop". I play "greeting" then "endloop" on the first trigger and then "idleloop" on the second trigger but "idleloop" doesn't actually loop, it simply plays once and then goes back into playing "endloop". How do I tell "endloop" to stop looping? I tried promoting the looping bool to a variable and setting this to false before playing "idleloop"and I also tried to play the "endloop" animation again before the "idleloop" and setting its looping state to false hoping it might reset its own state but its still stuck looping. Is there an option to clear all animation from a mesh before calling a new one?

alt text

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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