How exactly do I make a custom pawn movement component with humanoid behavior that obeys gravity (sorta like CharacterMovementComponent)? I’ve been trying to find this out online, but just couldn’t find it so posting it here. I really need a custom pawn movement component due to “sprinting”, so does any1 know about this?
This won’t work because the Character Movement Component doesn’t directly move the mesh (unless there are network corrections to smooth out) - and to work correctly the Primitive that it updates is not allowed to simulate physics.
ShooterGame has an example of a Character Movement Component with Sprinting. It’s relatively easy to do by inheriting from the default CMC and adding movement properties to it. Unreal Tournament does the same thing and has much more advanced movement. I’d look at the source for those.
It’s pretty easy to implement the basic idea of “sprinting”, but I don’t exactly think you get my point. I’m doing sprinting this way, and as far as I know, CharacterMovementComponent dosen’t support different velocities per direction
/** Modifier applied to forward movement */
float ForwardSpeedModifier = 1.0f;
/** Modifier applied to right movement */
float RightSpeedModifier = 1.0f;
/** Modifier applied to backward movement */
float BackwardSpeedModifier = 1.0f;
/** Modifier applied to left movement */
float LeftSpeedModifier = 1.0f;
At least, I know for certain that this isn’t possible with a Character, and CMC only supports Characters, I’m gonna have to make my own road with this :'3