Modhooks not fiiring on animal death

I’m trying to trigger an event to occur when an animal is killed and while testing I tried attaching both a Destroy Event Hook and a Activation Event Hook onto the Animal_Server gameobject. My thought was to determine if unturned just disables animals for pooling, or if they actually destroy the gameobject. Since both modhooks should be capable of catching one of those events. I then rigged them up to a server text chat messenger to debug which process was done.

Despite this, neither seem to be firing and I am very confused. I can’t seem to find any of the scripts that handle animals dying so it would be great to get some clarification on what’s going wrong here.

Try using “Activation Event Hook” on “Model_0”.

That was actually the first one I tried because my thought was I know at least the model is removed.

So I’ve been troubleshooting this for a couple of days and I’ve discovered that unturned does indeed use object pooling but it does it in a different way. Unturned doesn’t disable the gameobjects but instead disabled the mesh renderer, colliders, controller, audio source, and all of the collision triggers on the skeleton when an animal dies.

This means that there is no way for the activation event hook to actually listen for when the animal dies. I instead found a workaround by putting a collision event hook onto the animal and a gameobject with a collider tagged player on the ragdoll so that as soon as the animal ragdolled it would clip the box collider to trigger the event.

This worked as expected but it seems the event is passed globally to all instances of the Animal_Server making this whole endeavor pretty moot.