Apply velocity in direction your facing (including up)

Godot 4

Im trying to apply velocity in the direction the player is facing weather that be up, down, left, or right. additional info will be provided if needed

tried this
image

Is this related to your other posts? Your request seems in direct contradiction to this one, where you ask for movement to only affect the z axis, and seems like youā€™ve almost succeeded.

If itā€™s not then you can remove .z to apply the speed in any direction forward-facing and fix the type issue. It may need to be negative since forward is negative z.

velocity = -camera.basis.z * SPEED

but I think weā€™ve been here before too

Since Iā€™m not sure what exactly you have set up or what you want, hereā€™s a good template hopefully merged soon for a 3D, grounded player controller. It can jump, move in any direction it is rotated and seperates planar x/z movement from the gravity and jump based y axis.

If you could explain more about your scene tree and what your goals are for this project that would help us help you.

for your info it kinda is, just not the same part

1 Like

also thats about all i need to know about this stuff so thanks a lot for helping me learn this

1 Like

No problem, sorry for my confusion.

Hereā€™s the git pull request for the template, the conversation brought up includes a lot of good information.