This is a Godot 4 base project that can be used for games with First Person perspective.
Only about 70 lines of code written in optimized GDScript 2.0.
Movement calculation is independent from FPS. The player will move and rotate the camera at the same speed at any frame rate.
Show full description...
- Jump height (approx. m)
- Camera Sensitivity
The player movement is calculated as the result of vector forces:
- Walk velocity
- Gravity velocity
- Jumping velocity
There is a Sandbox.tscn scene that is used as the main scene of the project just to test the FPC, you can do whatever you want with it.
Also there are two functions included to capture the mouse (lock the mouse on the screen) or release it when needed: capture_mouse() and release_mouse().
If you like this project please give me a star on Github! ⭐️
🔗 Links
⚖️ License
This project is under the CC0 license, so you can use it for whatever you want on personal or commercial project. Recognition is not needed but is very much appreciated. You can reference me with bluesky: @rbarongr.com and give me a follow there.
🎮 Controls
KeysAction NameDescription
W, left stick upmove_forwardMove forward
S, left stick downmove_backwardsMove backwards
A, left stick leftmove_leftMove to the left
D, left stick rightmove_rightMove to the right
mouse, right sticklook_ + dirLook/Aim
Space, Xbox ⒶjumpApply jump force
Esc, Xbox ⒷexitClose the game
You can change any of this keys in: Project Settings → Input Map.
⚠️ Compatibility
If you are using Godot 4.3 or below, use v3.1.1. The versions from v3.2 will use Godot 4.4+.
Maybe you are interested in some low poly first person arms. 👐
Please consider making a donation to this project to keep it going.
Thank you to those who already donated 🫶