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"

Animation Montage Loop

I am having a problem. I created a animation montage with a beginning segment, a middle segment that loops and an end segment (It's an aiming animation for when you are in cover). I want the middle segment to loop while "right click" is held down. When release "right click" I want to play the end segment of the animation montage. Currently the beginning segment plays great, the middle segment loops correctly but when I release "right click" it doesn't play the end segment of the animation montage

alt text

Here is the code:

 void AArenaCharacter::OnStartTargeting()
 {
     AArenaPlayerController* MyPC = Cast<AArenaPlayerController>(Controller);
     if (MyPC && MyPC->IsGameInputAllowed() && bInCombat == true)
     {
         IdleTime = 0.0f;
         if (IsRunning())
         {
             SetRunning(false, false);
         }
         GetCharacterMovement()->MaxWalkSpeed = TargetingMovementSpeed;
         SetTargeting(true);
         PlayAnimMontage(AimHiLeftAnimation);
     }
 }
 
 void AArenaCharacter::OnStopTargeting()
 {
     if (bInCombat == true)
     {
         GetCharacterMovement()->MaxWalkSpeed = BaseMovementSpeed;
         SetTargeting(false);
         StopAnimMontage(AimHiLeftAnimation);
     }
 }

Product Version: Not Selected
Tags:
screenshot (88).png (653.9 kB)
more ▼

asked Feb 12 '15 at 10:16 AM in Using UE4

avatar image

Janyx
497 67 65 212

avatar image Feb 12 '15 at 10:51 AM

Hi, you should use

AimHiLeftAnimation->SetNextSectionName(FName("AimingL"), FName("StopAimingL"));

instead of

StopAnimMontage(AimHiLeftAnimation);

avatar image Janyx Feb 12 '15 at 04:48 PM

Thanks for the reply. I am trying it our but AnimationMontage doesn't appear to have a method called "SetNextSectionName()" do you know if they changed the name perhaps?

avatar image Feb 12 '15 at 04:54 PM

I'm sorry i was looking at the AnimMontageInstance class... I was confused by the methods exposed to Blueprint by AnimInstance

avatar image Janyx Feb 12 '15 at 07:51 PM

It appears "GetActiveInstanceForMontage" no longer works. Maybe they changed the way they do it but the documentation doesn't mention on changes

  FAnimMontageInstance * MontageInstance = GetActiveInstanceForMontage(*Montage);
             if (MontageInstance)
             {
                 MontageInstance->SetNextSectionName(SectionNameToChange, NextSection);
             }

Wondering if you have figured it out?

Thanks

avatar image Feb 16 '15 at 08:10 AM

I'm sorry, i only tried AnimMontages with Blueprint i tried to adapt what i did in BP to help you with your C++ version

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

0 answers: sort voted first
Be the first one to answer this question
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