#Orbital camera and player directions

1 messages · Page 1 of 1 (latest)

edgy crow
#

I have an orbital camera around my char and i want the player go towards the camera when i press DOWN and to the opposite when i press UP, but I'm not getting how to do it

sharp nacelle
#

you can get the direction the camera is pointing in via its transform, and then project that onto the x/z plane and normalize it to get a horizontal direction vector

edgy crow
#

i didn't get the second part

#

how would i project camera dir onto x/z

sharp nacelle
#

the orbital camera can tilt vertically, right?

edgy crow
#

yes

sharp nacelle
#

so basically the forwards direction of the camera would be the red arrow, and that needs to kinda be "flattened" onto the x/z plane to get the movement direction to use

edgy crow
#

ok, i'll try