theRealUnd3rdog / Godot_Noshot_Controller

NOSHOT First Person Controller
https://www.youtube.com/@UnderdogDen
MIT License
460 stars 41 forks source link

Gamepad controller addition #11

Open Gytaco opened 2 months ago

Gytaco commented 2 months ago

This is my attempt to add the Gamepad.

I added the core Joystick logic to the Process, though, and it didn't have a performance hit. Due to the continuous nature of Joystick input, this is the most reliable method in Godot. You could use the Physics Process, of course, but putting in Input leads to a very janky experience. This also allows the continuous control of the Camera in other areas like Wall Running, etc.

I added a Joystick on/off and a few other controls to better manage, as well as an invert. I decided to combine the RotatePlayer with mouse inputs rather than have 2 separate methods. If you wanted a hyper-performant option, it might be best to split them.

Lastly, all the input mapping has been added with the exception of the reset button still being 'r'

I made some design decisions, and while it's easy to put the logic in its own method if you prefer, I tried to keep it simple.

Lastly, I use Visual Studio so I added a gitignore just to deal with vs bloat when opening projects.

theRealUnd3rdog commented 2 months ago

I appreciate it, I'll merge this within the week