I want to get the velocity (IN VECTOR NOTATION) of the character BASED ON THE CAMERA’S DIRECTION (which is looking directly towards the character). I don’t want the vector to be based off the world axis.
I’m using the third person character example which has a camera component already attached.
What I expect is NO MATTER WHERE I ORIENTATE MY CAMERA IN GAMEPLAY:
- Whenever I push the forward button that is Up arrow or W key, the X-axis should always be 600 (600,0,0)
- If I push backwards that is Down arrow or S key, the X-axis should be -600 (-600,0,0)
- Strafe Left and Right with Left and Right arrow or A and D keys I should get 600 and -600 (0,600,0 or 0,-600,0) on the Y-axis.
- Of course for diagonals say Forward Right I should get 300 on both X and Y axis (300,300,0).
So far I’ve tried this but doesn’t work.
Can anyone help me out on this matter?