Trying to figure out teleportation using a hit from a Linetrace

Hi!

I’m trying to get the player to teleport from one location to the next.

However, i have looked into various examples and tried some but can not get the result i want. I don’t know if im stupid or missed something?

So i have a ladder thats retracted into the roof, when i look and interact with the ladder it folds down. When the ladder is in this folded down position i want to be able to press a key when im looking up in the hole above the ladder.

Hope it makes sens. i dont want an overlap event due to the fact i only want to teleport when i look up at the hole in the roof and then be able to press a key to teleport.

Hope someone could give an example or point me in the right direction.

I use linetrace for interacting with objects and world. tried to implement this with the teleport but i dont know if i-m missing something or if its even possible that way.

Thanks in advance!

Put an interactable collision in the hole. When you press your key to interact it should shoot up and hit that collision. On success do the teleport.

Do you already have the interaction function setup which folds down the ladder? If so, add a branch to the interaction which checks if ladder is down, if true, teleport player to top ( may want to add a dummy scene component at top of ladder actor above the ceiling and use its world loc as he teleport target). If the branch for ladder down check is false, continue to the folding logic.

On the player, I made e key do a linetrace and uses hit actor to send an interface message that fires that. The Scene nub there is a dummy scene component I stuck to top floor of folding ramp.