Teleporting player through portals

I’m trying to create a system of portals so that each portal has its paired portal to which you get teleported when you overlap with its “brother” and press space. So I created a Teleport blueprint which overlaps all and gave my pawn such blueprint:

However, it never teleports the pawn, there is just no reaction when standing on the teleport and pressing space. Why is that so?

@rXp - yeah, it does get called cause when I remove the branch checking if space is pressed, I get a crash when an overlap of pawn and portal begin because of an infinite assert loop

Hi,

Does the event ActorBeginOverlap get called ? If no, could you show us the collisions settings you set to your portals ?

Is it possible that when you press Space you didn’t take into account that you would get teleported and then teleported back because the boolean is still true.
If you don’t set a limit limit to one teleportation at a time you might get a crash (like a teleportation loop) because it will overlap with the first then the paired then the first etc… almost each tick.

You could also not teleport the player right on the paired teleporter, leave a space between them.

Yep, that is possible. So is there some easy way to solve this problem without the need to put some arbitrary timer before the next teleport is allowed? Also, I’d rather avoid teleporting to other location cause the whole thing here is that I need the player to appear right at the other teleport’s location :frowning:

Yes there is. Right before teleporting set a isTeleported variable to true. Then every time if the variable is true you don’t teleport. But if the EndOverlap event is called then set the variable to false :slight_smile:

I see but doesn’t that force the player to step off the portal they’ve been teleported to first if they want to go back? I mean - I want the player to be able to teleport to the other portal and - if, say, he’s made a mistake - let him teleport back again and do it back and forth as much as he wants to. If we solve the problem by allowing teleportation after the overlap has ended, won’t it be impossible?

Then when he teleports set the space down to false. He will just need to repress the key. (I think it’s not too much :wink: )

Thanks a lot for all the help - turns out I also had a flaw in my logic :slight_smile: Here’s the final version which works if anyone is wondering:

Great :slight_smile: then set this post as answer :wink:

But I can’t select a comment as an answer :frowning: If you want to, copy and paste your suggestions as an answer and I’ll happily accept it.

Then when he teleports set the space down to false. He will just need to repress the key. (I think it’s not too much :wink: )