Skip to content

Godot Engine 4 - First Person POV Character Control Mechanism

Notifications You must be signed in to change notification settings

irvinwidya/godot-first-person-controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

First Person Controller

A template for first person POV system for character using Godot Engine 4

Movement Control

W A S D : Forward, Left, Backward, Right

Spacebar : Jump

Shift : Sprint

Ctrl : Crouch

Mechanism

  • Character Movement Speed
    • Walking, sprinting, and crouching speed (crouching takes prirority over sprinting)
    • Gradual movement speed using lerp() function (so it doesn't looks snappy/choppy)
  • Character Collision
    • Changes collision height when crouching
    • Stay crouching when object/collision detected above character's head using RayCast3D node
  • Character Camera (Player's POV)
    • Camera rotation based on mouse movement
      • Y-axis rotation is set so camera can't rotate too much that can cause the world's view inverted (upside-down)
    • Camera height follows when character's crouching (also using lerp() to prevent snappy/choppy movement)

Note: The jumping mechanism is already GDScript built-in

About

Godot Engine 4 - First Person POV Character Control Mechanism

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published