(4.14) Destroy object when carried into trigger box

Hi all,
I’m quite new to this and its gone 2am so my apologies if this makes no sense.

I have a VR environment based on the UE template (version 4-14) and have an actor in the form of a box that i can pick up. I also have a trigger box in the environment.
I would like to be able to pick up the box and walk it to the trigger area and when the box makes contact with the trigger are the box the player is holding disappears (is destroyed).

would you be able to help with this?
I have been able to set it up so if the player makes contact with the trigger area the box is destroyed (regardless of where the box is in the map) but this isnt what im after.

any help would be much appreciated as it feels like im so close.

(or was until i changed some bits and now what i started above desnt work :smile:

Firstly, it’s much easier to do if the trigger is a BP, don’t try and do it from the level BP.

You can make the trigger like this

and it will kill any static mesh you put in there.

But, you probably want to be a bit more specific? A couple of easy ways are:

  1. Put an actor tag on the mesh when you pick it up

image

and then the destroy code would be:

  1. Your code in the trigger BP could check if the player is holding the mesh. It’s up to you how you do that.

Another slightly more advanced method, is to make the thing you’re picking up a BP also. You could call it DestroyableMesh or something. It’s just a BP with a collision volume and a mesh in it.

Then the trigger box code could look like:

1 Like

amazing thank you, spent another few hours on this and managed to get it working but replaced it with what you have here (much more elegant solution.

Next up I need to work out how to spawn things once I have destroyed them.
I know you should never assume but can a spawn actor be placed after the destroy actor action has taken place?

You can do stuff ( like spawn ) after destroy, because the destroy is on the mesh, not the trigger BP running the code :slight_smile:

thanks, only take 2 hours to work out how to spawn things successfully (genuinely happy with that, especially when 24hrs ago I hadn’t even got ue installed on my PC).

Good work :slight_smile: