Hey Tony,
couldn't find this anywhere...I'm using the Spawned Object Manager to save spawned enemies, but it still spawns them after they are dead. How do I make it so that it won't spawn enemies that are dead? is there a method to remove them from the Spawned Objects list?
Not saving Dead emenies
Re: Not saving Dead emenies
Hi,
Make sure your enemies have a SpawnedObject component. If they are only deactivated, and not destroyed, when killed, change Mode from OnDestroy to OnDisable. When the SpawnedObject component detects that the GameObject has been destroyed or disabled, it will remove itself from the Spawned Object Manager's list.
Make sure your enemies have a SpawnedObject component. If they are only deactivated, and not destroyed, when killed, change Mode from OnDestroy to OnDisable. When the SpawnedObject component detects that the GameObject has been destroyed or disabled, it will remove itself from the Spawned Object Manager's list.
Re: Not saving Dead emenies
ah, that makes it a bit more difficult, since I want their bodies to hang around while the player is still in the level.
But I think I can detach the model game object from the parent and then destroy the parent.
Thanks Tony!
But I think I can detach the model game object from the parent and then destroy the parent.
Thanks Tony!
Re: Not saving Dead emenies
Set the mode to Disable. When the NPC dies, just disable the Spawned Object component.
Re: Not saving Dead emenies
ah! that makes much more sense!