[Demo] Character Controller with HFSM

A Custom Rigidbody Based Character Controller

Monday, November 22, 2021

About

In this project, I built a custom rigidbody-based character controller. All its actions, like jumping, climbing, and moving, are done with an HFSM (Hierarchical Finite State Machine), an implementation of the State Pattern.

Some features include:

  • Ground Snapping and Slope control
  • Custom Gravity
  • Physics and Rigidbody interaction
  • Variable Height Jump and Coyote
  • Surface Climbing
  • Swimming
  • Relative movement (like sticking to a moving platform)

All the code is available at Github.


WebGL builds are not supported on mobile devices.

Move - WASD / Arrow Keys
Jump - Space
Climb - L. Shift
Swimming Up/Down - Space / L. Shift