You pushed it up. The ground kept it.

The problem
Velocity up, still on the ground.
if ( _cc.IsOnGround ){ _cc.Velocity = _cc.Velocity.WithZ( 0 ); if ( Input.Pressed( "jump" ) ) _cc.Velocity += Vector3.Up * JumpForce;} _cc.Move();
While IsOnGround is true, Move strips the up and down part of your velocity. The push is thrown away.
The fix
Let go of the ground first.
Punch unsticks the controller from the ground, then adds the push. That is a jump.
Punch=leave the ground+add velocity
The fix in code
Jump with Punch.
if ( _cc.IsOnGround ){ _cc.Velocity = _cc.Velocity.WithZ( 0 ); if ( Input.Pressed( "jump" ) ) _cc.Punch( Vector3.Up * JumpForce );} _cc.Move();
Punch lets go of the ground first, so Move keeps the push.
Watch out
Punch works in midair too.
It doesn't check the ground for you. Call it outside IsOnGround and every press jumps again.
- Inside IsOnGround
- one jump
- Outside it
- jumps forever
- Want a double jump?
- count the jumps yourself
The rule
Jumping? Punch, don't push.
- Jump
- Punch( Vector3.Up * f )
- Only from
- IsOnGround
- In midair
- Punch still pushes