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 tell a montage to loop?

Dear Friends at Epic,

Yaaay Thank you for UE4!!!

I'm using the montage playing functions from shootergame example.

I understand that there are new montage functions already in the upcoming build

but how do I currently tell a montage to loop itself?

I see how to make an animsequence loop itself in the anim blueprint.

but I want to make a looping montage without having to call it repeatedly in the code

:)

for your reference:

 float AVictoryCharacterBase::PlayAnimMontage(class UAnimMontage* Anim, float PlayRate)
 {
     float Duration = 0.0f;
 
     //modified from shootergameCharacter.cpp
     if (Anim && Mesh && Mesh->AnimScriptInstance)
     {
         Duration = Mesh->AnimScriptInstance->Montage_Play(Anim, PlayRate);
     }
 
     return Duration;
 }

Rama

Product Version: Not Selected
Tags:
more ▼

asked Mar 11 '14 at 02:15 AM in C++ Programming

avatar image

ue4-archive ♦♦ STAFF
50k 3667 1996 9121

avatar image JonathanTewnes Jan 14 '19 at 11:27 PM

Thank you Rama we are still using your answer 5 years later

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

1 answer: sort voted first

In the Montage itself, make sure you have a Section for the animation you want to loop.

In the Section area, click the track for that section, then click the button for that same Section. This will tell that Section that it is supposed to loop. You can do this with one or more animations.

alt text

So here we have a string of animations defining a swinging weapon. We want the Swing1 and Swing2 sections to loop until we let go of the mouse button. So in the Sections area, we choose the track for Swing1, then click the green Swing2 button. Then click the newly added Swing2 in that track, and click the green Swing1 button to add Swing1 again. Montage detects the repetition and turns that Section into a looping one. Now, whenever you call that section to play, it loops automatically, playing Swing1, then Swing2, then Swing1 again, and so on.

I hope this helps!

montageview.png (35.9 kB)
more ▼

answered Mar 11 '14 at 02:15 AM

avatar image

ue4-archive ♦♦ STAFF
50k 3667 1996 9121

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

oooh wow thanks Zak!

I dont think I would have guessed all that in a very very long time :)

I saved your description and the picture to my hard-drive, thanks for taking the time :)

Will probably write up a tutorial on this once I get it all working :)

Thanks again!

Rama

(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