[Question] Event On Movement Mode Changed Functionality

Hi guys,

I’m currently using the Event On Movement Mode Changed node to determine when I start falling in the world. It works perfect for falling, but I also have several custom movement modes I would love to use this node for:

Sprinting, Crouching, Melee Fighting Stance, Bow Fighting Stance, Swimming, Carrying, and about 5-6 others I can’t currently remember.


Some Context:
I see there’s a Custom node, but have no idea how to use it or what the functionality represents. I guess I’m in need of some general enlightenment on how I could use a node like this to determine when any one of my 10 custom movement modes change.

Currently my goal is to build an energy consumption formula that consumes energy at different rates based on movement modes. Because I couldn’t figure out how to add custom movement modes to the existing built-in list, I decided to make an Enum (since it asks for a byte pin). I’ve built my energy consumption formula and I’ve assigned different consumption rates based on each custom movement mode via Switch on Enum, but I’m trying to figure out the best way to tie that into a node that checks when an Enum (in my case) changes, and updates accordingly.

I wish I could’ve phrased this better but my understanding on Movement Modes is limited. If there’s a way to add to the currently built-in list of Movement Modes, I’d do that instead of my own Enum.

Thanks!

As an update, I opened the C++ and found that this node seems to be derived from the Character Movement component and is built in. There is space in C++ to add your own custom modes, but it looks like replication (and maybe other things) would have to be handled by the author. Since I’m not qualified to break open C++ and start doing useful things, I decided to re-write my system into a math formula rather than a list of enums. This allowed me to use the existing booleans (IsSprinting, IsCrouching, IsAttacking, etc) to determine a composite energy consumption rate.

I’ve been struggling to figure out how to take advantage of custom movement modes for a long while now with little documentation on the blueprint side. I finally figured it out last night so I put together a basic visual explanation on the Unreal Wiki:
Blueprint_Creating_Custom_Character_Movement_Component

hello sw_hornet. i don’t know how to otherwise get in contact to you. but i have a question concerning your tutorial.
you have another macro inside your macro, named “player direction” A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums.
and i do not know what it does under the hood. can you post a screen of it?
i also send you friend request in the epic games launcher. perhaps we can talk there, since i am interested in your insights concerning the custom movement mode.
greetings
sascha

Thanks for giving some feedback on the tutorial. I just included the screenshot for the “Player Direction” for you. Hope that helps!

thank you hornet for making the tut more complete. however i still have problems with the “LCS using ladder” function and “LCS can the player touch the ground”
what are they?
also, how would i implement this in the actual ladder? trigger box and change movement mode and thats all?
thanks again for sharing and caring!

Both of those components you mentioned are optional and not really relevant to creating a “Custom Character Movement Component” within that tutorial.

The “Can player touch ground” is just a trace from an Unreal sphere (created within the Character’s components) downward to see if it collides with a mesh within a certain distance.

The way that a potential ladder system could be set up:

  • A trigger box built around the ladder geo within a ladder blueprint.
  • Overlapping that trigger would send a “cast to” to a custom event within the Character’s blueprint which would align the player to the active ladder and change the movement mode to ladder climbing which branches into a custom blueprint function that only allows the player to only go up and down.
  • That movement mode change would also be cast to the Character’s animation blueprint so that in the state machine the character will begin playing the ladder mount animation before remaining in a climbing state.

There are lots of other complicated situations when dealing with getting out of ladders but that should help with understanding one direction to go in.