Hi!
I’m working on a custom creature spawner with a custom skeleton mesh that spawns instead of the creature. Easy enough, just hide the creature mesh and spawn the custom one with a walking animation. Attack animations plays when creature is close to players. Idle animation still has issues which I explain below.
My question is, why is the SprintedEvent() on the creature fort_character not working? Once the creature spawns, I keep the reference of the agent. This gives me the fort_character. I immediately subscribe to the SprintedEvent() but it doesn’t do anything.
MobSpawned(Creature : agent):void=
Print("Creature spawned!", ?Duration:=3.0)
if (cFortChar := Creature.GetFortCharacter[]):
cFortChar.SprintedEvent().Subscribe(MobMovementUpdate) #Check if the mob is idling or moving
Pos := cFortChar.GetTransform().Translation
cFortChar.Hide()
Instance := SpawnProp(MutantMeshWalking, cFortChar.GetTransform())
if (M := Instance(0)?):
UpdateMutantInMap(Creature, M)
spawn { FollowCreature(cFortChar) }
MobMovementUpdate(MoveResult : tuple(fort_character, logic)):void= # NOT WORKING FOR CREATURES
Print("Movement update!", ?Duration:=3.0)
bMobIsWalking := MoveResult(1)
if (bMobIsWalking = true):
Print("Creature started walking", ?Duration:=3.0)
else:
Print("Creature is idling", ?Duration:=3.0)