Best practices for modulizing actions on character?

Hi there guys, thanks in advance for giving yourself the time to reading this.
Very quick background first.

I’m creating a C++ project and right now what i have succeed in doing is creating a movement component for a character that can:

  1. WallSlide/WallClimb (like parkour) on Walls that the character cannot climb.
  2. Ledge Grab when reaching the apex of a wall, the character will start grab the ledge and climb to the end so he can be on top of the ledge.
  3. Hook Movement Implementation: you set a target point and the movement component will make the character travel to that point, triggering an event when it reaches the destination or it’s interrupted by something in it’s journey

So, first of all i’m not sure if the movement component was the right place to set that logic, but due that it has to do with the movement of the character, and i didn’t want to use those patches (force the character to move with teleport or force move the component) because i felt it didn’t take into considerations the collisions in logic.
Second, i’m right now trying to figure where and how to put the Attack actions of the character, i want the character to be able to use a primary and secondary weapons, but being able to change it (think of melee), and each weapon should have its own combo/damage.

Should making an Attack Component be the right way to implement this? how do i deal with the weapon wanting to move the character while the movement component wanting to do the same thing? It has something to do with the RootMotion that the C++ movement component mentions nearly in every movement mode?

I’m sorry for being so abstract on this question, but this design question is what really has me troubled

Best of luck for everyone Cheers

Hi HeavyBullets,

I’m no expert in unreal, but I have a similar issue with gravity in my game, I’m approaching this using inheritance of the movement component. From the sounds of it you are spot on as you can re-use that component with different Actors.

My sage approach (from years of development in other areas) is to follow the rules of not modify the game engine and leverage the engine as much as possible (i.e. not re-invent the wheel) and definitely not fight it. It might not be perfect, but you are in the herd and it is proven code.

Obviously you must be pretty smart to achieve what you have done. :slight_smile:


Oh thanks a lot man, the big problem is how to make the attack component (or any other component for that matter) apply movement to the character without stepping on the domain of the movement component… i know that the movement component has checks for Root Motion and that’s maybe the answer, make the animation drive the motion when it has to (in the case of the attack for example). I just want some insight of people who has done this in the way unreal wants you to do it, which is using components

Cheers everyone and i hope you can share your expertise with us