Destroy a actor attached to player

Hello,

So I have a key that upon overlap it attaches to the player.

This key also triggers doors.

All works fine, except I cant seem to figure out how to make it so the upon entering the doors trigger box it will delete just this key attached to the player.

As the level has other keys its important that only the key attached to the player is destroyed.

Cheers

Do you want all of the keys to be unique? As in open up only 1 door? Also, does the player need to hold many keys at once?
There are a number of ways to possibly do this. The easiest way, if the player doesn’t need to see the key in an inventory or on the player, or anything, would be to create booleans for each key and when the player picks up the key, destroy the key in the world and then set the boolean for the key to true. Then the door trigger volume would just check the boolean on the player.

Another way would be to create key variables (or an array of key variables) (whatever class your key is) and then on pick up set the variable to the key and destroy the key in the world. Then you could just destroy the key variable on the player when the door opens. With an array you would cycle through the array until you find the key you want.

If you want the key to be attached to the player so you can see it you could create a child actor on the character and leave it null. When you pick up a key you would set the child actor to the key. Then when it’s used set the child actor back to nothing. However this would only work if the player holds only one key at a time.

It’s OK with the keys as I have all the mechanics in place.

I was just referring to the destroying of an attached actor but as you recommended the child component I will give that a shot later today.