Build charge for jump with physics character?

I’m trying to figure out how to code a charge jump for a physics based character instead of a standard character, but all the tutorials I can find consist of regular characters instead of physics based ones. Is there anything I can look into to help figure it out?

Just the basic jump that’s included with the Rolling Ball Blueprint.

Do you have any sort of jump implemented yet?

I would create a float variable “JumpPressTimer”, and a boolean variable “JumpIsPressed”

On tick, If JumpIsPressed = true, Set JumpPressTimer to Min( JumpPressTimer + deltaTime, MaxHoldTime)
If JumpIsPressed = false, Set JumpPressTimer to 0

On your jump press event, set JumpIsPressed to true.
On your jump release event, ApplyImpulse or ApplyForce proportional to JumpPressTimer, and set JumpIsPressed to false.

I would Apply Force [Base Impulse vector] + [ Jump Scale Impulse Vector] * JumpPressTimer.
For instance, try Base Impulse Vector = [0, 0, 500] and jump scale vector = [0, 0, 500] with MaxHoldTime 2.

Ok, I did it in blueprint so you can copy easier. Add your object into the impulse thing, and replace “Gamepad Face Button” with your jump input event. I didn’t test it, but if it doesn’t work let me know- it’s relatively simple.

JumpTimeBeforeStartCharging is how long you have to hold until the jump starts charging. JumpMaxChargeTime is how long you can charge up. JumpBaseVector is the amount you always jump. JumpChargeVector is the additional amount you gain per second of charge. JumpPressTimer starts at -JumpMaxChargeTime and goes up to +JumpMaxChargeTime when JumpPressed? is set.

Variables:

127395-graphvariables.png

Tick event:

Jump input event:

Thanks man, I’ll look into putting that in and I’ll see how it goes.