Giter Site home page Giter Site logo

modcommunity / dot-fps-controller Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 3.0 23.69 MB

An open source 3D first person player controller for @godotengine that supports bunny hopping, air strafing, and more!

Home Page: https://moddingcommunity.com/topic/187-fps-controller-dot-fps-controller/

GDScript 100.00%
bhop bunnyhop controller fps gdscript godot godot-engine godotengine lerp movement

dot-fps-controller's Introduction

An open source 3D first-person player controller for Godot Engine (version 4.3 and should work with 4.2). This controller currently supports air strafing, bunny hopping, crouching, walking, and more!

This asset is a big work in progress and we plan on adding more features along with improving the current player movement in the future as we develop our own open source games.

Features

  • Air strafing
  • Bunny-hopping (with auto-hop option)
  • Crouching
  • Sprinting
  • Walking
  • FPS and speed 2D labels

View our roadmap here!

Godot Input Actions

The following input actions need to be added to the Godot project via Project -> Project Settings -> Input Map for the controller to work properly.

Action Description
player_l Moves the player to the left.
player_r Moves the player to the right.
player_f Moves the player forwards.
player_b Moves the player backwards.
player_jump The player jump action.
player_crouch The player crouch action.
player_shift The player shift action.
player_walk The player walk action.

Note - Mouse wheel up button is supported for the player_jump input!

Note - The player_crouch, player_shift, and player_walk inputs works as press and release. For example, the player must hold the input down to crouch and release it when they want to stop crouching.

Controller Settings

The following are variables exported by the player controller that can be modified outside of the controller.

General

Setting Default Description
verbose 0 The verbose level (determines what is printed to the Godot debug console).
mouse_sens_x 0.3 The mouse sensitivity while looking left and right.
mouse_sens_y 0.3 The mouse sensitivity while looking up and down.
max_look_angle_down -90 The max look angle down.
max_look_angle_up 90 The max look angle up.
max_slope_angle deg_to_rad(45) The max slope angle.
crouch_depth -0.5 The depth to apply when crouching.
crouch_lerp_speed 12.0 The lerp speed when crouching.

Feature Settings

Setting Default Description
can_noclip false Whether the player can noclip (not yet implemented).
can_crouch true Whether the player can crouch.
can_sprint true Whether the player can sprint.
can_walk true Whether the player can walk.
can_auto_hop false Whether the player can auto-hop by holding down space.

Movement Settings

Setting Default Description
max_speed 7 The max speed.
speed_left 0.100 The left speed.
speed_right 0.100 The right speed.
speed_forward 0.100 The forward speed.
speed_back 0.100 The backwards speed.
crouch_speed_multiplier 0.4 The crouch speed multiplier.
walk_speed_multiplier 0.4 The walk speed multiplier.
sprint_speed_multiplier 1.5 The sprint speed multiplier.
accelerate 3 The accelerate speed.
air_accelerate 100 The accelerate speed while in air.
max_air_speed 1 The max speed while in the air.
friction 1.5 The amount of friction to apply.
stop_speed 10 The stop speed.
gravity 25 The amount of gravity to apply.
max_velocity 40000 The maximum velocity.
jump_height 1 The jump height.

Preview

Here are some GIFs and images showcasing the controller as of 3-2-24.

Video

GIF 01

Images

Image 01

Image 02

Credits

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.