Respawn new character at collision box

I want to swap out my character when player hits the E key and is overlapped on the trigger box.

This is my trigger box graph:

I am having trouble destroying my 1st character and continue the play with my second character, as well as linking the E key to the trigger box function. Does anyone know how or if there’s a better way to do this? thank you!

Its not working because you’re trying to spawn the new actor at the location of the actor you just destroyed which is going to be null. Spawn the new character before destroying the old and since the actor is going to be destroyed, there’s no need for a do once node as that actor will no longer exist after that interaction

There are a variety of ways you might link your interact action (e key) to the trigger box, the simplest is probably to defer to the character. Which would involve putting a boolean on the character that controls whether the action does anything, and toggle that from the trigger box on overlap start/end.

Then in the character check if that flag is set before proceeding with the morph.
I see a need for local variables so I would have the event graph simply call a function:

Which in turn does all the work:

Collects and saves controller and transform before destroying itself, to avoid problems accessing things in a destroyed actor (which may actually not be a problem, it certainly won’t be nulled for a while after you destroy it, some values may get defaulted though, or other things go awry, so a good idea to grab what you need from it before destroying).

NB: Above code not tested, maybe incomplete / non-functional, but I think it looks right.

Hi! would you mind pointing me out where to get the “on component begin overlap”? Mine only shows “Add on actor begin overlap (trigger box)”. I’m doing this in the level bp.

If using a generic trigger box in the level, you will need to bind the events manually.
Get/find your trigger box somehow, grab its Collision Component and bind the events to that:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.