1 of 18

Character Controller

2 of 18

FEATURES

  • HIERARCHICAL STATE MACHINE

  • FLOATING CAPSULE

  • CAMERA RECENTERING

  • ROOT MOTION

  • BLEND ANIMATION

  • IK SYSTEM

3 of 18

HIERARCHICAL STATE MACHINE

  • Based on basic finite state machine, but more scalability and more provide to make various states with organic transition with other states.

  • The Structure looks like Base State -> Type state -> Implement state.

  • Base State is for organizing and managing with another state.

  • Type state is more concept state for implementing concrete state.

  • Implement state is really acting which I want to play or do some actions.

4 of 18

HIERARCHICAL STATE MACHINE

AIRBORNE STATE

IDLE

MOVING STATE

STOPPING STATE

LANDING STATE

WALK

RUN

SPRINT

LIGHT

MEDIUM

HARD

LIGHT

HARD

ROLL

JUMP

FALL

GROUNDED STATE

5 of 18

FLOATING CAPSULE

  • Two types of player standing with ground which is Floating Capsule and using Capsule collider fully charge of player’s height.

  • I used floating capsule for fixing sophisticated movement parts which are slope, stairs, terrain, and other ground environment.

  • Using some mathematical code, Calculate whether the player can stand on the ground.

6 of 18

FLOATING CAPSULE

7 of 18

FLOATING CAPSULE

8 of 18

CAMERA RECENTERING

  • Motivated by the Genshin Impact game.

  • Simple concept is if player move to horizontally then the camera will recentering to player.

  • This will make if player move horizontally then the player will move as a circularly.

9 of 18

CAMERA RECENTERING

10 of 18

ROOT MOTION

  • More make realistic movement with animation.

  • The animation affected to character transform.

  • But it can make some bugs with control transform code, so we should be taking care of this problem.

  • Also, the character physics is affected by the animation which means that the collider can be changed position, rotation, and scale.

11 of 18

ROOT MOTION

12 of 18

ROOT MOTION

13 of 18

BLEND ANIMATION

  • More make animation smooth when transitioning with other states.

  • Different animation will blend smoothly.

  • More make character animation looks cool.

14 of 18

BLEND ANIMATION

15 of 18

BLEND ANIMATION

16 of 18

IK SYSTEM

  • Change character bones with code.

  • Makes more realistic interaction with physics object.

  • Access to character model’s bones and change the model’s transform with code.

17 of 18

IK SYSTEM

18 of 18

IK SYSTEM