How to teleport between two meshes
Hi guys, im completly new to visual scripting.
The idea is to be able to place two different boxes in the level during runtime. By overlapping your pawn with a box, it should teleport the pawn to the other box, if both boxes exists in the level. So i thought i can do this by creating two different blueprints for each box. I tryed to create a "destination"-variable for each blueprint. So if both boxes in the level exists, i should automatically get a reference to my destination-variable for each box (box 1 should get a reference to box 2 and visa versa). How can i achive this? So i could easily work with the "Get Actor Location" Branch by pointing to the destination variable. Or has anyone another idea how i can achive a teleport between two boxes in a level? The hard thing for me here is, that the boxes are created during runtime and they are not yet created when the level is loaded (and should not thoo). Thank you for any advises! :)
asked Dec 04 '16 at 09:46 PM in Blueprint Scripting
If you create the teleports at runtime, you get the references to them when you spawn/create them. You could temporarily store those teleport references as local variables and assign the destination variable on both of them once you've first created 2 teleports.
So, step 1: create teleports and store their refs into local variable etc. step 2: assign the cross references.
Alternatively, you could just poll the level for other actors of the class (https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/FindingActors/Blueprints/) and get the references that way. But this is a naive approach to solve the problem as it's slower and you already get the references when you create the teleports.
answered Dec 04 '16 at 10:29 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here