How do i not teleport outside the map

hello i have made an ability that allows the player to teleport through walls and such using the teleport node and some line tracing only problem is he is able to go outside the map i have tried blocking everything in collision but he is still able to do it

Hi!

You can add blueprint classes to the blacklist of the LineTrace, so it ignores objects of that blueprint type. If you than Raycast that specific object, no hit event is fired. The other possibility could be to disable HitTesting for raycasts in the blueprint which you don’t want to teleport through.

I hope these ideas steer you in the right direction!
Best whishes!

that sounds like it is exactly what im looking for …but where would i find them have not used line tracing much so im not sure where they would be or what it would be under?

As you can see on this page, the LineTrace Node takes an parameter called “Actors to be ignored”. This is an array where you can pass all your walls you want to ignore. The other possibility could be to have an Blueprint for your walls with an bool variable “CanPlayerTeleportToThisWall?” or something like that. When your linetrace hits a wall you cast to your blueprint and check if the bool is true, otherwise you won’t do anywthing. Third possibilty: You have two Blueprints. The first for the walls where the player can teleport through and the second where the player can’t. After the line trace hits something, you try to cast the hidden actor to the first bp (where the player can teleport through). If the cast works, you teleport, otherwise you don’t. Last possibilty: You set up a new trace channel, for further information go here. I hope that helps you :slight_smile: