Skip to content

rbarongr/GodotFirstPersonController

Repository files navigation

Godot 4 - Basic First Person Controller

This project contains the basic implementation of a First Person character controller for Godot 4.

The code found in player.gd uses vector forces to move the player. You can tweak the values of the forces in the editor directly. The velocity of the player is calculated as a result of the vector sum of different vector forces: walk, jump and gravity.

The main scene is a Sandbox scene used to test the controls:

EditorView

Controls

Keys Action Name Description
W,A,S,D, left stick move_ + dir Move
mouse, right stick look_ + dir Look/Aim
Space, Xbox Ⓐ jump Apply jump force
ESC, Xbox Ⓑ exit Close the game

You can change any of this keys in: Project Settings → Input Map.