Blueprint Creating Custom Character Movement Component

From Epic Wiki
Jump to: navigation, search

Template:Rating

Purpose and Use

How to create a custom movement mode so the character can climb a ladder.

I tried two separate times to figure out how to use a custom character movement mode in blueprints with no success and ended up just using a workaround with the existing preset modes. There's very little documentation about how to do this in blueprints and the concept is a bit different using Enumerated types. I finally figured it out so I decided to do a quick tutorial to hopefully visually bridge the gap of understanding for someone else. If someone see's a better way to do this then please update.

Assumptions

  1. You know how to create and edit Persona blueprints.

Setup in Character Blueprint - Event Graph

  1. The "Climbing Ladder" variable in the images is a Byte which I happen to have set to 7 just for the sake of being in order of the different EMovementMode variations already existing although I think you can start at 0.
  2. "Can The Player Touch The Ground" is doing a Line Trace to see if the character is close to the ground. (Optional)
  3. Using Calc Velocity will affect all the other movement modes so be aware but I adjusted Delta time to 1 to speed up offsets and Braking Deceleration to 40 to give a bit of follow through

Setup in Animation Blueprint - AnimGraph

  1. I had to use Cast to Character in the event graph of the Animation blueprint to transfer the "Climbing Ladder" byte variable over from the Character Blueprint.
  2. Some of the wiring like "Getting Direction" could be put into a Macro function