/First-Person-Controller

A controller with multiple functionalities and parameterization to make it easy to start new games

Primary LanguageGDScriptMIT LicenseMIT

GodotParadiseFirst-Person-Controller logo

Godot Paradise First Person Controller

LastCommit Stars Total downloads License PRs Welcome Kofi

es


A ready to go First person controller highly customizable with interaction system implemented. You can scan to be able inspect this objects on the viewport, rotate, pickup, etc.

Requirements

📢 We don't currently give support to Godot 3+ as we focus on future stable versions from version 4 onwards

  • Godot 4+

✨Installation

This is a template based repository, to start using you need to use the Use template green button on the top right corner of this repository.

This will fork the content from the main branch and initialize a fresh start new project with the first person controller ready to use.

Global Settings

An autoload class is provided to manage the settings that could be useful to make them available to the player for exchange. Head movement and mouse sensitivity parameter may cause motion sickness in some people.

@export_range(1, 10, 1) var MOUSE_SENSITIVITY = 3
@export var HEAD_BOBBING : = true
@export var MOTION_BLUR := true
@export var SWING_HEAD := false

Exported parameters

## MOUSE AND CAMERA SENSITIVITY
@export_group("Sensitivity")
## The global sensitivity with the mouse that is applied in the entire game camera movement
@export var MOUSE_SENSITIVITY = GlobalSettings.MOUSE_SENSITIVITY
## The camera sensitivity to balance the smoothness of the rotation
@export_range(0, 1, 0.01) var CAMERA_SENSITIVITY := 0.3

## FREE LOOK FEATURE ##
@export_group("Free look")
## Free look feature is active for the controller
@export var FREE_LOOK_ENABLED := true
## The smoothness applied when neck is rotated on free look
@export var FREE_LOOKING_LERP_SPEED := 10.0
## The tilt on degrees for the neck when free look is active
@export var FREE_LOOK_TILT := 5.0
## The initial rotation when free look is active, set to max value to rotate directly the neck to the maximum rotation
@export var FREE_LOOK_INITIAL_ROTATION := 0
## The maximum neck rotation when the character is free looking
@export var FREE_LOOK_MAXIMUM_ROTATION := 120

@export_group("Head bobbing")
## Enable head bobbing for this First person controller
@export var BOB_ENABLED := true
@export var BOB_VECTOR := Vector2.ZERO
@export var BOB_INDEX := 0.0
@export var BOB_LERP_SPEED := 10.0
@export var BOB_SPEED = 7.5
@export var BOB_INTENSITY = 0.1

@export_group("Swing head")
## Enable the swing head when move on horizontal axis (right & left)
@export var SWING_HEAD_ENABLED := false
## The rotation swing to apply in degrees
@export var SWING_HEAD_ROTATION := 5
@export var SWING_HEAD_ROTATION_LERP := 0.05
@export var SWING_HEAD_RECOVERY_LERP := 0.15

@export_group("Camera FOV")
@export var camera_fov_range = [2, 75, 85]

Accessible normal variables

var IS_FREE_LOOKING := false
var LOCKED := false

Inputs

This Godot project come with a premade input map, feel free to change it as your needs

Camera

Mouse Use the mouse as usual to look around in all directions, the horizontal movement rotates the entire body. To only move the head take a look at Free look

Movement

Up Left Down Right W A S D

Sprint

Shift - Keep pressed this key to run, a sprint runtime can be configured to limit the time the player can run as well the recovery time to be able to run again.

Crouch

Ctrl - Crouch Shift - (while crouching) Crawl

if a ceiling collision is detected, it is not necessary to hold down the key to remain in this state.

Slide

Ctrl Press this key when you're running and you will execute a slide that allows you free look on the action. You cannot control the direction while is sliding but you can jump. The speed slows down as it slides

Jump

Space

Free look

Alt Keep pressed this key to look around with your head using your mouse. Useful when you want to look behind but wanting to keep walking ahead.

✌️You are welcome to

GodotParadise is available for free.

If you're grateful for what we're doing, please consider a donation. Developing GodotParadise requires massive amount of time and knowledge, especially when it comes to Godot. Even $1 is highly appreciated and shows that you care. Thank you!


🤝Contribution guidelines

Thank you for your interest in Godot Paradise!

To ensure a smooth and collaborative contribution process, please review our contribution guidelines before getting started. These guidelines outline the standards and expectations we uphold in this project.

📓Code of Conduct: We strictly adhere to the Godot code of conduct in this project. As a contributor, it is important to respect and follow this code to maintain a positive and inclusive community.


📇Contact us

If you have built a project, demo, script or example with this plugin let us know and we can publish it here in the repository to help us to improve and to know that what we do is useful.