How to change where player is looking?

I been using teleporters and there are working as I want them to. But there is one problem whenever I teleport I am not looking in the direction I want to. I was wondering how I can change where the player is looking after I teleport. Instead of looking at the floor or looking at a wall.

It will even ensure there is some wiggle room for the pawn.

Alternatively:

image

Or:

image

Or another 5 ways, most likely.


Or are you asking how to build an appropriate rotator?

2 Likes

You can use FindLookAtRotation:

2 Likes

How would I find my Target Rotation?? :thinking:

In your teleport function you can add a parameter(function interface most likely) for each of your teleport area, that parameter you can hardcode a fix value Location/Rotation where you want the player to look at, at that specific teleporter.

1 Like

How do you know the direction you want face on arrival?

1 Like

I been trying for a while now of what you said but I think I am doing it wrong can I get a picture for an example?

Forward

Forward of what? Player’s current forward? World axis? Another actor’s forward?

1 Like

If you are already hardcoding the value location of your teleporter area, you can just hardcode it rotation as well.

Now if you want thing to be dynamic, you will want to use function interface or event dispatcher. Such that in each of your bp teleporter instance area, you will have your Location and Rotation.

2 Likes

Is there a guide online to help me out with this problem? I been trying different things to try to solve this. It’s been a week and got nowhere

You can use the method i posted before, this should fit your need because there no proper target object you can look at so you will most likely do need a hardcode value for each teleport area.

1 Like

Hardcode? is that C++. BTW started using unreal back in mid November

it mean adding a fix raw value you know of.

If you want to teleport to Area A and want to look at a specific direction, you just insert that raw rotation into your event rotation for each of your teleporter.