How to add a movement type inherited from Walking Like Covering?

I want to implement new movement types like Covering or Legde Grabing

In Covering case it needs physics and other thing like Walking.
how can i implement thease without reimplement functions?
it seems if movement types were classes we could defines new ones inherited from others and change the differents.

There is no way to simply add a new Movement Type?

CharacterMovementComponent supports custom movement modes. Whether or not a completely different movement mode is the right choice for your situation (compared to extending an existing mode) is up to you.

To use custom modes, you define an enum that lists the custom modes you want to use. You then use SetMovementMode(MOVE_Custom, YourCustomMode). In code, you override PhysCustom(), look at what your current mode is (CustomMovementMode stored on the component), and then execute your custom code. In blueprints, you can tie in to UpdateCustomMovement() instead, which is very similar.

For some modes that are very similar to walking (like cover), you may want to instead add restrictions on how input is filtered (don’t apply the input unless it makes sense while in cover), or restrict the possible areas in which the character may move (snap their position back to within some area if they move out of it). This is pretty game-specific, but could be accomplished either before or after the normal movement update.

4 Likes

Thank you for your answer.