i'm terrible at programming help me this is all i have and even this doesn't work

move forward and back

look left and right

i have "up" "down" "left" and "right" mapped to W, S, A, and D respectively

looking left and right works, but i cannot move, and i also would much MUCH rather use mouse input for looking, but i have no idea how?

please help

tell me if you need any more info

If your player is a KinematicBody (or a Sprite), then physics don't affect it. You'd want to use "move_and_slide" to move it around (or even just adjusting the "position" manually, but this isn't a good method for a more featured game). For mouse looking you want to get the delta mouse movement. You can see if you can get the mouse position of the viewport, then minus the last mouse position (you'll have to save this as a variable) will get you the mouse movement in the last frame. Then you can tie that to looking.

@cybereality said: If your player is a KinematicBody (or a Sprite), then physics don't affect it. You'd want to use "move_and_slide" to move it around (or even just adjusting the "position" manually, but this isn't a good method for a more featured game). For mouse looking you want to get the delta mouse movement. You can see if you can get the mouse position of the viewport, then minus the last mouse position (you'll have to save this as a variable) will get you the mouse movement in the last frame. Then you can tie that to looking.

how do i do any of that lol (i'm very bad at everything because i'm a near-100% beginner)

If you just want to get started, instead of "set_linear_velocity" use a "set_position" but add the current position to the "vector3" you created (that is leading to the "set_linear_velocity" which you can delete). Otherwise I would recommend using "move_and_slide". You can keep all the rest of the code the same, just that last "set_linear_velocity" should be replaced with a "move_and_slide". For that function to appear, the object of the script itself needs to be "KinematicBody" you should be able to change the class by right-clicking on the object in the tree graph. I would start there.

greeting. I hope it is useful. This is the configuration i recommend.

only there is a drawback.

@cybereality said: If you just want to get started, instead of "set_linear_velocity" use a "set_position" but add the current position to the "vector3" you created (that is leading to the "set_linear_velocity" which you can delete). Otherwise I would recommend using "move_and_slide". You can keep all the rest of the code the same, just that last "set_linear_velocity" should be replaced with a "move_and_slide". For that function to appear, the object of the script itself needs to be "KinematicBody" you should be able to change the class by right-clicking on the object in the tree graph. I would start there.

ok i did this (plus solved the issue of i-was-using-two-scripts-like-an-idiot) and now i need to make the movement depend on the rotation and i am thoroughly lost

an apology my intention was to do it in steps.

this is the part to move according to the camera

this is how the finished code looks

but it also works with a kinematic Body. with a function Move_and_slide ()

this is how the finished code looks

somehow i'm even more lost than before and now no inputs work.. what's the quickest way to switch this all to normal code lol

Remove the visual script from the node and add a new script. You won't be able to avoid actually writing it though.

@Megalomaniak said: Remove the visual script from the node and add a new script. You won't be able to avoid actually writing it though.

wish me luck!

2 years later