Modular player controller for Godot 4
DUE TO MICROSOFT POLICIES, WHICH I CAN'T ACCEPT, THE REPOSITORY HAS BEEN MOVED TO https://gitlab.com/gamesnotdeveloped/godot-uniplayer
Warning The code is still under development and contains unresolved bugs
- Build your own player controller from small components
- Create custom abilities and behaviours
- Use one of the available prefab: FPS Human, FPS FlyingMachine, etc.
- Customize prefab by adding custom behaviours
- Duplicate built-in prefab and customize it to fit your needs without feature loss
- Use in your commercial work thanks to permissive license
- Allows to use custom meshes and collision shapes
- Copy
addons/uniplayer
to the project'saddons
directory - Enable
UniPlayer
plugin in your project (AssetLib -> Plugins)
- Create or open existing scene
- Clisk "chain" icon (Instantiate Child Scene) and search for "FPS"
- Select
FPS_Human_Controller
- Tune properties exposed in the prefab
- Add more abilities as child nodes to the prefab instance
- Make it local and change anything you wish (remove / add abilities or behaviours)
- Extend the prefab with your custom class, add properties and implement features you need
- Extend
UP_BasePlayer
class - Add
RotationHelper
and camera as it's child - Add abilities and behaviours you need
Tool | Description |
---|---|
MouseCapture | Captures mouse pointer on startup |
RotationHelper | Makes selecting RotationHelper node easier (Editor only) |
Adds ability to control the player's head by mouse.
- walk
- run
- jump
- crouch
- fall down
- footsteps
- camera zoom on demand
- player's health regeneration at specified intervals
- killable player
- respawning
- tracking last "good" position
- multiple respawn strategies:
- disable controls and leave player died
- respawn at initial level position
- respawn at last known "good" position
- just emit a special signal
- quit the game
- kill player based on world's Y coordinate
- override respawn strategy or use default
- FPS human-like being with typical abilities and behaviours.
Use as a parent node for the player's camera. It is not mandatory, but many built-in abilities are based on this node.
Add this to your scene for toggling mouse capture by ESC key.
- I added an abilitiy, but it does not work
- What's the difference between abilities and behaviours?
- Is RigidBody-like character supported?
- Can I use UniPlayer for controlling a vehicle?
- Can I build specialized controller top of this plugin?
- Can I use the plugin in my commercial product?
The selected ability may require assigning a proper node (RotationHelper, Camera, other ability or behaviour).
Currently the difference is only in naming things. Abilities and behaviours extends same UP_BaseAbility
class.
Currently all abilities are designed only to work with CharacterBody3D
. This is requirement of the UP_BaseAbility
.
This may change in the future.
This is theoretically possible and probably will be, but not in the current version.
Definitely. I highly recommend using the plugin as a lightweight base for more complex controllers.
Yes. You may note the autor somewhere and add link to this repository.
HeadRotation
has no rotation limitations- In the editor's class/nodes browser, the custom types are registered directly under
Node
and aren't grouped
- possibly rename the project
- documentation
- tutorials
- more useful abilities
Time is money. Do not waste it for bloatware.