Playing animation from start (AnimBlueprint)

Scenario:
I have a FPS player controller that can melee attack. When player melees, the AnimBP (Anim Graph) fires off the AnimMontage that plays the melee animation (0.583 seconds long).

The issue is that if you use the melee button about 10+ times, the animation begins to slowly “drift” the start time. In other words, every time the melee is used, the animation will never play from the first frame/sec in the animation every time (which it’s supposed to). If you hit the melee button enough times during gameplay, you will eventually have the melee anim play starting from the middle of the animation as opposed to from the start of the anim!

Is there some way to tell UE4 to play the anim from the beginning of the anim (frame/second 0) every time the animation is called up? This is essentially what I need.
I looked all over the docs, checked all the properties for my animation, AnimMontage, AnimBP- everything, and all I find are properties for turning on/off looping, rate scale, etc.; but there is no option for playing an animation from start (every time). This is really weird to me, because it’s a pretty basic parameter that exists in all engines.

What am I missing here?

I dont have editor here so cant post screen shot but, if I am not mistaken the default option for animation is to use looping interpolation. If you turn that off the animation will instantly jump to the first frame when playing it, instead of get there “smooth”. See if that works.

Hey Squid, thanks for the tip, but unfortunately that parameter doesn’t make the animation play from the start, when the animation is called :frowning:

I’m wondering if there is a BP node or something that one can set to “reset” the playback of the anim within the AnimBP?

This is so weird…

This seems like a simple thing to do- has no one had the need to set anims to play from start every time they are called up?

This is important for many situations, some examples:

  • equip weapon anim for any FPS game
  • grenade throw anim
  • pretty much any anim that requires NO
    looping, instead playing from start
    of anim every time

Pretty much everyone developing any serious project or game with UE4 has to have come across this issue. Anyone figured out a solution? Still can’t find an option for setting anims to play from start when called…

Ok I finally figured this one out.

The solution is not via an option somewhere that tells Unreal 4 to treat the animation as looping or play once (stupid Unity screwed up my thinking there lol).

Instead, you have to treat state machines and anything inside the AnimGraph as looping- animations here will always loop, regardless.

To get animations to play once, you have to do the following workflow:

  • create AnimMontages of your animations (i.e. melee strike, grenade throw, etc.)
  • assign a “slot” name, whatever you like (there’s extensive docs on this)
  • plug the custom slot in your AnimGraph (your final animation must flow through the slot node!)
  • in the AnimBP EventGraph, create your functionality to fire the AnimMontage you want with a Montage Play node
  • enjoy your cool game!

Some information that made the light bulb turn on in my head can be found here:
link text
(scroll down to the part on setting up the AnimMontage)

If anyone has any questions, I can post some step by step screen shots showing the process…

Jesus… Thx mate!

Is there any way to assign this workflow into a Subinstance AnimBP?
I would like to do this in a Subinstance, but Subinstances doesnt support Slot Nodes
(they dont blend in parent class).

another way is this, if you already are in too deep into your current work flow just make a State instead of adding the anim directly… https://answers.unrealengine.com/questions/258910/is-there-really-no-way-of-reseting-states-in-animg.html?sort=oldest