Download

How to keep triggers updated across actor resets?

I have an actor that I use physics constraints with (two used as hinges and one as a latch, to make a trap door that breaks). I decided to make triggers to break the latch (just a box mesh with an OnComponentBeginOverlap event that calls the latch constraint’s break constraint function).

I also need to reset it, however, so I (after storing its transform) destroy the actor, and then respawn a new one from class (SpawnActor). The triggers, for both resetting and breaking, are obviously unaware of these new ones, since the names are different from the base trap door placed in the world. Is there a way to keep the triggers updated with these new actors, or does this problem require a re-thinking in C++?

Ok I am trying to understand what you are doing? You have two triggers one reset/spawnsactor and other one breaks/destroys?

They’re actually the same trigger with an enum serving as a “menu,” but yes, I have two of them in the level and they do those two things.

Save the actor as a variable when it’s created, and as None when it’s destroyed then check. Create ether some sort of event or event dispatcher so the other volume can knows what is going on.