As seen in the attached video, I have created an anim montage that plays well in the editor. In blueprints, I have set it up to play when the character gets hit. However, as the video shows, in game the animation snaps between frames (or is in other ways bugged). I cannot figure out what the problem might be. What might even cause this weird behavior?
I have experimented with different blend in/out options, but none seem to work. I have other animations that use the same options and they work just fine. The montage slot is also correctly set since other anim montages that use this slot display correclty.
Does anyone know anything that might help me debug this? I would be very grateful for any hints.
What about the possibility that it isn’t animation related?
Does your AI have things like turning to face the player on tick and things like that? Because it seems like it is rotating to face the player mid-air.
The enemy AI is disabled in this video. He won’t react to the player in any way. The hit character is just set to play the anim montage when overlapping the yellow hitbox.
@TheMarvok Is it possible it’s attempting to play one additional time each tick it’s colliding with the sphere? Try adding a “Do Once” before the Montage and then on montage completion, reset the “Do Once” node?
Looks similar to Replication Graph animation tick optimization.
Could there be any runtime optimizations changing the animations tick rate / update during the playback?
I have checked this. But sadly no. It is set up correctly to play one time only upon begin overlap (plus I made code that double checks to not apply the effect twice).
I am also not aware of any runtime optimizations that could change the animation tick rate since I haven’t added anything myself on top of the default options.
I have noticed something that might be a clue.
The animation sequence I’m using is 60fps but when I drag it into the montage it becomes 30fps. This seems like it might be causing frame skips in editor (and there is one that is particularly jarring), however I don’t see how this could cause such a discrepancy between what I see in the editor and in game.
Sadly, the update rate optimizations didn’t change anything. But I managed to somewhat improve the result by explicitly stopping all other animations before playing this one.
What bugs me the most is that despite doing this, the animation is still skipping multiple frames during the moment that the character turns around in the air.
All other root motion animations work fine (such as the animation of getting up from the ground). But it still doesn’t explain why it look good in the editor, but not in game.
I suspect this particular animation’s problem is that it contains very rapid rotation of the character and unreal just doesn’t want to play all the frames in game.
Have to agree with @fllightp here in that it seems to be a bug. The “twitching” disappears for me when I reduce blend time in my montage to about 1.5 (previously 2.5). The issue gets worse when I increase blend time beyond that.
Another solution is to use inertialization instead of standard blending, which comes with its own set of problems and might not be the correct approach for all animation setups.