I’m creating a monster spawner that can play animations on the spawned monsters. The spawn animations are set up so that the root bone is on the ground and the mesh starts below the root and then animates up to idle.
The problem I’m having is that when the monster is spawned it is visible for a frame in its bind pose. I’ve tried setting it invisible immediately after calling SpawnActor and then using a custom animation notify to set the character visible, but it hasn’t helped. I’ve also confirmed that it’s not a problem from the character blending from bind into the spawn animation.
Here’s what my spawn code looks like:
AMSCharacter* SpawnedMonster = GetWorld()->SpawnActor( CharacterToSpawn, SpawnLocation, SpawnRotation, SpawnParams );
if( SpawnedMonster )
{
if( SpawnMontage )
{
SpawnedMonster->GetMesh()->SetVisibility( false, true );
SpawnedMonster->SetActorHiddenInGame( true );
SpawnedMonster->SetSpawnAnimation( SpawnMontage );
}
++TotalSpawned;
}
The visible bind frame appears about half the time when monsters spawn. Any idea how to get around this? I’ve thought about spawning the monsters at some distant point and then moving them into position when setting them visible, but I’m hoping for a better solution.