2023-11-24 13:33:21 -08:00
# quality-godot-first-person-2
2023-12-02 15:19:47 -08:00
Actually good first person controller for the Godot Engine.
2023-12-01 22:26:46 -08:00
MIT License (credit Colormatic Studios)
2023-12-19 18:30:25 -08:00
This first person controller was made because there aren't many first person controllers for Godot, and the ones that do exist are pretty bad.
2023-12-01 22:26:46 -08:00
It is highly customizable and comes with many features, QOL, and clean code.
Some parts came from StayAtHomeDev's FPS tutorial. You can find that [here ](https://www.youtube.com/playlist?list=PLEHvj4yeNfeF6s-UVs5Zx5TfNYmeCiYwf ).
# Directions
Move with WASD, space to jump, shift to sprint, C to crouch.
**FEATURES:**
- In-air momentum
- Motion smoothing
- FOV smoothing
2024-03-01 16:15:58 -08:00
- Movement animations
2023-12-01 22:26:46 -08:00
- Crouching
- Sprinting
- 2 crosshairs/reticles, one is animated (more to come?)
2023-12-19 18:34:49 -08:00
- Controller/GamePad support (enabled through code, see wiki)
2023-12-01 22:26:46 -08:00
If you make a cool game with this addon, I would love to hear about it!
# Wiki
2023-12-19 18:30:25 -08:00
**To start out**, you should probably remap all of the movement keys to your own control set.
2023-12-02 15:19:47 -08:00
You can make this a super basic controller by just disabling everything.
2023-12-01 22:26:46 -08:00
2023-12-19 18:34:49 -08:00
**How to add controller/GamePad support**
2023-12-19 18:50:18 -08:00
- In the controls export group, there is a commented section at the end that says "Uncomment this if you want full controller support". Uncomment that block.
- Make a key map for each direction (left, right, up, down) and map them to your joystick.
- Write in these keymaps in the controls section of the player settings.
- In the `_process` function, there is another block of commented code at the end that says the same thing. Uncomment that too.
- You should now be able to look around with the joystick. Make sure you add the other controls to the input map. (movement, jumping, crouching, sprinting, etc.)
2023-12-02 15:19:47 -08:00
2023-12-19 18:30:25 -08:00
**How to change settings:**
2023-12-02 15:19:47 -08:00
Click on the character node and there should be settings in the "Feature Settings" group.
**How to add animations for a mesh:**
2023-12-19 18:50:18 -08:00
- Create a function for your animation and attach it to `_physics_process` to call it every frame.
- Use `input_dir` as a boolean (it is actually a `Vector2` ) to know if the player is walking.
2023-12-19 18:52:46 -08:00
- Use the `state` member variable to tell if the player is sprinting or crouching.
2023-12-19 18:50:18 -08:00
- Use the `is_on_floor` function to tell if the player is standing or falling.
2023-12-01 22:26:46 -08:00
2024-03-01 16:15:58 -08:00
**How to change reticles (crosshairs):**
Change the "Default Reticle" setting to your reticle file.
During runtime:
Use the `change_reticle` function on the character.
2023-12-01 22:26:46 -08:00
2023-12-02 15:29:30 -08:00
**How to create a new reticle:**
2023-12-19 18:52:46 -08:00
- Choose a reticle to base it off of.
- Open that reticle and save it as a new reticle.
2023-12-19 19:30:16 -08:00
- Remove the script from the reticle and create a new one. (for some reason you have to do this)
2023-12-19 18:52:46 -08:00
- Edit the reticle to your needs.
- Follow the "how to change reticles" directions to use it.