Custom Movement System

How would I go about making a custom movement system?

I want it to have:

  • Tweened running speed (when you start normally moving your walk speed tweens up to max over time, already implemented)
  • Sliding
  • Diving
  • Dashing
  • Other ways to change walk speed like status effects or boost pads

My main concern is finding a way to have all of these things in 1 movement system without anything walk speed or animation related things clashing together and making a buggy mess. I’d also like to know what objects (LinearVelocity, etc.) i’d need to use to make each of these movement objectives. Any help would be very much appreciated!

You should look into this article: Character Controllers. The ControllerManager, along with classes such as GroundController and SwimController, provide access to underlying features of Humanoid without all the bloat and are far more customizable!

This looks cool but I don’t know how this can help me with my tasks and especially my main concern. Could you explain how these can help me make my movement system with the features provided? In the meantime i’ll look at the article to see if I can piece this together myself.

The central component of a system like this will be a ControllerManager. Its BaseMoveSpeed property is similar to that of a Humanoid’s WalkSpeed property, however, automatically takes into account the MoveSpeedFactor property of a ControllerBase (Air, Climb, Ground, or SwimController) when the ActiveController property points to such an instance. You’ll need to manually update properties such as FacingDirection and MovingDirection based on user input (I highly recommend the Input Action System if you’re not already using that).

The specifics of your custom movement system, might determine how you approach representing various “states”, however from your list, it may look something like this:

  • Walking/Running - Use a GroundController. Tune properties to affect acceleration, deceleration, friction, etc. You may consider splitting “walking” from “running” into two GroundControllers or modifying properties via script.
  • Sliding - Use a GroundController with MoveSpeedFactor set to a low value closer to 0 and also consider changing Friction/FrictionWeight and/or a large DecelerationTime. Set the ControllerManager’s ActiveController to this ControllerBase when a “slide” is started and revert to “walking” or some other default state when you detect that the slide is over.
  • Diving - Probably use a GroundController. Fundamentally, a “dive” is pretty similar to a “slide” (less control over direction due to decreased friction). For some use cases an AirController combined with an ApplyImpulse call might work here though.
  • Dashing - If you’re looking for something like a “quick-dash” where the player moves instantaneously in a particular direction, you may consider a raycast and CFrame operation.
  • Status Effects - There’s loads of ways to approach this and it can be highly dependent on the specifics of your use case (ex. Do status effects have multiple levels? Can multiple similar effects stack?). Considering a case where you might want to give a player a “Slowness” effect using a ControllerManager system, you could add a Folder under the ControllerManager named “StatusEffects”. To add a particular effect, add an instance to this folder with Name matching the intended effect and attributes to vary the strength of the effect. From a script, detect the addition / deletion of these instances and modify the BaseSpeed, or other properties, of the ControllerManager accordingly.

Ultimately, animations are best used when they effectively communicate the state a character / controller is in and hide any transition between states. The system should work as intended without any animations (from a physics perspective) and animations simply react to changes to the ongoing state/physics of the controller.

I was able to get the system set up via another post I found on the forum. This gives me more insight into what I can do for my game. Thank you very much!