Hi all! I'm working on my first Godot game, and I'm trying to achieve a super specific thing I hope you can help me out with 🙂
Here's the idea; I have a RigidBody3D that can move around my 3D environment no problem. I've got a placeholder script that lets it move with arrow keys, but what I really want is to be able to steer by moving the mouse and move it in the specified direction by clicking.
I made a little doodle to demonstrate what I mean.
I've got an idea in my mind of how I want to make that work; I've already got some code in the player script that grabs the mouse's angle from the center of the screen according to a 2D pointer. What I want to do is take that value and apply force to the RigidBody in that direction while the left mouse button is pressed, effectively steering it in the direction of the mouse. The tiny problem with that is I have no idea where to start!
A few notes:
-The body itself doesn't need to rotate or anything (unless, of course, that would send it in the direction I want it to go!).
-The reason I'm using RigidBody for the character is I like the way it skids and slides around on the ground. I'd prefer to keep it in RigidBody, but if that's not possible I can switch the type and write a script to make it slide around manually XD
-I'm a beginner! I still don't understand how some stuff works at a fundamental level yet, so please be patient ^^
I'll drop the player.gd and pointer.gd scripts below so you can get a feel for how I've got things set up right now.
[upl-image-preview url=
Can anybody help me out with this? Let me know if I didn't give enough info to be able to help. It's been stumping me. Thank you!