Kill credit from spawned object's damage

If a player places an object in the world with a trigger that causes damage when contacting it, how do I keep track of the damage being applied by the player that placed it, so that they get kill credit if it causes the enemy to die.

I'm not sure how to assign an owner to the object. I have the script that causes damage attached to the object that is spawned.

Not sure if this matters, but I am using the team deathmatch framework.

I think I got it. I was having trouble getting the owner of the damage being applied. I just needed to move the script.

But your suggestion- GetOverlappingObjects() should help with another issue I was having with it :slight_smile:

You can get the players within the trigger using the trigger's GetOverlappingObjects() method.

If you instead want to create an object that players can shoot at and possibly destroy, I would recommend trying the Destructible Object kit I posted on the Community Content. It uses the NPC AI Kit to handle damage. You can listen for the "ObjectDamaged" event fired by the NPC AI Kit and find the source of the damage (in your case the source would be a player).