Cant teleport to a mesh with line trace

hehe, yeah, that’s a little inefficient. Your additional line traces aren’t actually being used - you aren’t using whether anything was hit, or the impact point. What it ends up doing is essentially passing the ‘end’ input pin of the line trace to the ‘trace end’ output pin of the hit, and using that for the teleport. You could skip the the line trace and just directly hook that up to the teleport

to create the loop:

from the initial collision, store the hit->Location to a variable.

create a ‘for loop with break’ node. number of iterations can be whatever you like, but 3 is actually a reasonable number of attempts, so start index = 1, end index = 3 (or whatever you like)

int * float node (50 * for loop index)

vector * float node (forward vector * output of above)

vector - vector node (the hit->location variable you stored - output of above)

use the result of that as the teleport input location. if the teleport result is True, hook back around to the ‘break’ pin of the for loop, and it will won’t try any more.

the loop node’s completed pin will then execute (regardless of the teleport’s success). I would suggest setting a flag (boolean variable) after a successful teleport. If that is true, play the success sound. if false, play a fail sound (so the player at least gets some feedback if it doesn’t work)

but honestly, the loop code doesn’t help you much if you know you want to do the 3 attempts you’ve already got set up. Just remove the extra line tests, and it’s good.