CharacterMovement (Bunnyhop etc.)

Hello guys!

I’ve recently started using Unreal Engine and have enjoyed it so far. I’m currently trying to implement some custom movement that is similar to Quake-Engine games (like Jedi Outcast). For this I’m having a Character class (derived from ACharacter) which has the built-in CharacterMovement. Through the ACharacter functions like CanJump and CanJumpInternal_Implementation I changed the way jumping works to kind of get BunnyHopping.

Now I want to customize this even more (give the player more control in air for example). For this I would create a new class that derives from the CharacterMovement and then override a few functions to change it the way I want to. Would that be “compliant” to the way an “Unreal Developer” would do it?

From Unity I know it can be important to somehow change the way you do things (or you’re used to do things) to be more in-line with what the Engine actually wants you to do.

Thanks for all the help!

In case somebody has a similar problem, here’s what I did in the end:

  • Created a new class derived from APawn.
  • Attached a StaticMesh (Capsule)
  • Disabled physics simulation for this StaticMesh/Pawn.
  • Wrote the movement code in the new class directly

Well the “Unreal Developer” way to do it would be to override UCharacterMovementComponent and add bunny hopping in there. Character movement components already have parameters related to air movement, the main one is AirControl, which lets you set what amount of control over movement you have in the air. You might be interested in this page that talks about how bunny hopping is coded. Also, UCharacterMovementComponent has a lot of code that deals with things like stairs, standing on moving objects, replication, network smoothing and anti-cheat. I recommend just extending the systems they already have rather than trying to make your own.