Is there a forward vector that includes changes in the Z

While using the getActorForwardVector() I get the normalize vector of where the actor looks in 2d (only taking into account x & y).

Is there a way to include the z axis as well? (so if the player looks a bit up, its z value would increase while the x&y values would decrease)
So for example if a player looks forward, its current value is (1,0,0).
But if the actor looks up, its forward vector should be (0,0,1)

I know I can technically do so by taking the original forward vector (1,0,0) and using 3 rotation matrices (one for X, one for Y & one for Z) to turn it accordingly, but is there a more simple way?

if the player looks a bit up

Use the camera fwd vector. You can even:

image

1 Like

Thank you (tbh it makes much more now that I think about it… what turns up is the camera while the player itself only turn left and right according to where you look)

1 Like