I have an animation blueprint with the first state called spawning. In this spawning state, there are many anims and it picks (uses blend poses) the anim based on a variable enum. The variable enum is set during “Event blueprint initialize Animation” by picking the value out of the pawn/character owner. If I instantiate the character in the editor by dragging the character blueprint to the level and set the varible enum in the details panel and press play then the character plays the initial/spawning animation perfectly on both the client and server.
But we have spawners in c++ that calls spawn actor on that character blueprint. The spawner sets this enum on the character. On the server, the character spawns in and plays the animation just fine but on the client it does not play the same animation. It seems the variable on the character replicated too late on the client.
My question is in two parts:
-
Is there a way in c++ to spawn an actor, set a member variable to be replicated before replication so that when it appears on the client the variable has been set just like location?
-
If not then is the way I described setting an initial animation the correct way to do it? Is there a better way?
thanks