-
Notifications
You must be signed in to change notification settings - Fork 14
Locomotion
This section will provide you with an overview of how the Locomotion works.
The current implementation of Locomotion is based on Unity's CharacterController component and Unity's Animation Rigging package for Inverse Kinematics.
All the Locomotion and IK settings are centralized at the CharacterControllerSettings scriptable object.
The locomotion system features the following:
- Input handling
- Simple jump (tapping the jump button)
- Long jump (long press jump button)
- Coyote timer
- Sprint and Walk
- Stun (when falling from very high places)
- Sliding from slopes
- Stuck prevention from multiple slopes
- Network replication
- Platform movement
- Emotes
- Inverse Kinematics for:
- Feet
- Hands
- Head
The Locomotion is being initialized at CharacterMotionPlugin
All the systems are composed of running and jumping can be found at:
- CalculateCharacterVelocitySystem
- InterpolateCharacterSystem
- RotateCharacterSystem
- CharacterAnimationSystem
For other Locomotion-related systems, check out the folder: Assets/DCL/Character/Systems for all the systems involved in the character manipulation.
The locomotion movement and physics are being simulated by the Character Controller component in the CharacterObject prefab.
The Animator and IK setup is at the AvatarBase prefab
The CharacterAnimator asset contains the AnimatorController which has all the proper transitions, check the inner states for more information about the transitions.

The AvatarBase prefab has the Armature of a DCL avatar, the scale of the Armature GameObject must be 0.01 and a rotation of 90 on the X-axis since the avatars are big and rotated.
They are inside a folder in AvatarRendering/AvatarShape/Assets/Animations/

To avoid having GLB files in the project we extracted them as separate assets.