I want to dynamically set what animation my skeletal mesh uses when spawned so that I can use context set in the Spawn Actor from Class node to determine how it appears. The problem is the animation blueprint evaluates its starting pose before the mesh’s owning actor has initialized, so there will always be a single frame at the default pose. I have tried hiding the mesh until the animation has been initialized, but I have not found a reliable way to tell when that happens.
I am trying to make this as efficient as possible and modular, requiring minimal upkeep on any components/animations I might add, so avoiding notifies, delays, and monitoring variables on event tick/update
I have tried:
- setting “Pause Anims” to true by default, setting it to false after the animation has been set, then setting “hidden in game to false.” - still visible at default pose for a frame
- Using the “OnInitialUpdate” and “OnBecomeRelevant” functions on the sequence player. - Nothing useful is thread safe.
- Using an assortment of Blend Pose nodes. - Any variable I could use is not initialized before the first frame is evaluated.
- Using “Event Blueprint Initialize Animation” in the ABP to trigger after the animation is dynamically set. - It evaluates before the owning actor is initialized, including its expose on spawn variables even if paused.
- Exposing “Spawn Actor Deferred” and “Finish Spawning Actor” functions as blueprint nodes. - ABP still initializes instantly, all issues persist regardless of timing.
- Exposing “Anim Sequence Base” variable on spawn from the Actor. - Actor’s “Expose on Spawn” variables read as null when the ABP runs the “Event Blueprint Initialize Animation” function.
- Setting the mesh’s anim class at runtime. - Any variable that could be used in the ABP cannot be manipulated until the class has been set, even if exposed on spawn, so default pose persists for 1 frame.
- All of the above but with “Set Timer for Next Tick by Event” to delay setting visibility to true until presumably after the dynamically set animation has begun. - I have no explanation for why this doesn’t work. I still see the default pose when I set the animation → Pause anims = false → Set Timer for Next Tick by Event → Hidden in Game = false
This shouldn’t be hard. All I want to do is dynamically set the initial animation without having to hard code anything or clutter up my assets with workarounds.