Im trying to set up a blueprint for triggering a custom event after the player attempts to teleport to a certain area. Basically the player is told to teleport to a circle in front of them, however trying to do so will trigger another event with some pop up UI and the player shouldnt move (yet). Once the UI blueprint executes, the teleport area is unlocked and they can actually teleport there. I know how to trigger custom events from one blueprint to another, but not sure how to go about blocking the teleport and having it trigger another event. Hope that makes sense. Any help much appreciated.
Thank you, thats helpful. Still not quite sure how to trigger this code when the player points the controller at the “pad” and attempts to teleport… I should’ve mentioned this is a VR project. Im assuming I would need a blueprint to check for the line trace from the controller and whether its hitting the pad before triggering the rest of the code?
If you’re stepping on a pad, to go to another pad, this code would be in the pad.
If you’re just pointing at a pad and moving to it, this code would be in the player.
Sorry If Im not explaining it well… The part Im having trouble with is actually triggering this blueprint. I know how to make a custom event but not sure what to trigger it with in this case. I need it to fire when the player points at and tries to teleport to the pad.
Also just as a quick test I actually tried to teleport the VR pawn to a new location (with a trigger box) using the same blueprint as in your screenshot but it didnt seem to work. I plugged in another blueprint at the end which shows a simple box mesh once the VR pawn overlaps the triggerbox and it worked, but the pawn wasnt teleported.
EDIT: I changed the “Get Player Character” node to “Get Player Pawn” and it worked
It sounds like you need “teleport target areas” to have the capability of being locked.
Then, you need the “teleport to area” action to have some logic for whether the target location is locked or not, before it actually attempts to do the teleport.
One way to implement “target is locked” is to define an interface for “ITelportDestination” with a function “CanReceiveTeleport(player, position)” that returns a boolean. Then make the area by default implement “return true” and if it’s locked, instead instantiate some additional blueprint, and return false.
The action would then cast the target area to ITeleportDestination, and call this function, and then not teleport the player if the function returns false.
Thank for the info. Sounds a tad beyond my current knowledge to be totally honest, BUT I have just realised I was overcomplicating things. Instead of doing it the “proper” way, whatever that may be, I simply used a trigger box to teleport me back to the exact same position, hence not actually moving the player at all (sort of). The same blueprint then triggers my UI and destroys the trigger box actor allowing me to teleport again. Still hoping to learn more about blueprints to do this the proper way at some point but for now it works