Above are two of my sequences and you can see the similarities. The only differences are the events triggering them, which only differ by the trigger box they are derived from, and then the location the actor is teleported to.
Or you could create you own overlap detection object, that way you can add any number of properties in the inspector. Add a vector property ( check “Show 3D widget” to make it cooler ) representing the location you want to teleport to and move the user there on “E” press.
First, I would take the logic out of the level blueprint and put it into an actor. Level blueprints are really just for level specific functionality that won’t need to be expanded to other level or repeated. Make it modular so you implement it once and reuse it by creating a new teleportActor and implementing everything inside it. Then you just drag as many in as you need teleporters, etc.
The teleportActor can have a target property that is set to point at an instance of an actor in the level or set to a location in level. After you drag it into the level you just set the public property on the instance.
Triggering it could go different ways. Either:
- The Character/Pawn handles E and checks if he is overlapping a teleporter. If he is, then he calls a function on the teleporter to move him.
- Or the teleporters all handle E and each one does a check every time. Less efficient perhaps but depending on scope not a big deal.