Restart a Montage Section
I'm using a simple attack queueing system. If he's attacking and the player presses attack again, it queues that attack.
Attacks vary in length, so I use anim notifies to tell the game when the attack has ended.
The problem is this: If the animation sends the notify at the end of the attack it is never sent due to blending. If it calls it near the end of the attack the montage is still playing that section and for some reason it has no way of restarting the section. Edit: Even if I go to other sections it doesn't work.
How do I make it so that it will play the next attack? My debug code tells me that it is being executed properly and the anim montage is not working.
It also requires a do once node otherwise the attack plays varying amounts of time - I don't understand this.
Edit: It's associated with the 'doonce' node, without it - it plays my animation however many times it feels like, usually once or twice. With it, it can't play the animation on the frame that it resets or something. I have no idea how to work around this.
Old post, but since I approached the system again the answer is basically don't use notifies because they aren't reliable, this is still true in 4.12.
In hindsight, the animation should only ever be aesthetic and not function, instead of using montages I use PlayAnimationAsDynamicMontage() and stop/set it based on a start timer when it begins then checking the length + start timer vs GetWorld()->GetTimeSeconds().
answered Jul 09 '16 at 10:45 AM
Well you have not shown the Logic you did for this.
From the scratch, without having it tested, i maybe would do it like this.
You have your AQS (attack queueing system) which stores the attacks in a dynamic list with a first in first out logic.
When player attacks, send an entry to the AQS AttackList. When your AI (or whatever) attacks do so as well.
The AQS will have the attacks chronological saved.
Then Fire the attack stored in the first index. If its finished remove the attack from AQS. Then Fire the attack stored in the next index. and so on.
However i not 100% sure if you remove the first index will result that the next index becomes the first automatically.
But you can tell me your current solution too :)
answered Jan 05 '15 at 09:39 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here