Here’s how I would do it.
- Create a custom Actor blueprint (derive it from Actor), calling it ‘BP_TeleportTargetActor’ or something like that.
- When doing the hit trace, attempt to cast the hit actor to your BP_TeleportTargetActor class.
- If the cast succeeds, you can get use the GetActorLocation node to get the exact location of the BP_TeleportTargetActor that was hit by the line trace (or, you could just use the hit result’s Location variable to get the exact location where the trace struck the actor)
- If the cast fails, do nothing, because the trace didn’t hit a relevant (teleport) actor
And that’s pretty much it. I guess if you need to teleport to a location slightly different than the actual location of your BP_TeleportTargetActor, you could always add a public Vector variable to the BP_TeleportTargetActor blueprint which stores the exact teleport destination for that room, and just access this variable after the cast node in your tracing blueprint.
Hopefully this idea will work for you, or at least helps you along your way!