Set LaunchCharacter velocity based on jump starting location?

Hello!

I’m having an issue with a jump pad where I want the player to jump on a jump pad, but be able to be launched exactly the distance where the jump start is. I’m needing to measure this because I want to dynamically be able to do this if a launch pad is further away from the player, but the jump pad will launch the character be the same launch length of the distance between right when the character jumped and when the character collided with the jump pad.

LaunchCharacter(FVector(0, 0, JumpStartVector.Z - GetActorLocation().Z), false, false);

I get the length of the Z, but it’s not giving me the impulse.

If anyone could help that would be awesome!

Hey there, if i understand correctly you want to be able to automatically calculate the impulse that the jump pad needs to give the player in order to reach a wall on the other side that is on the same height. I’m assuming that JumpStartVector is the character’s world location when you started the jump, so you use the height difference to calculate an impulse that he needs to get to the other side. First of all, i think the impulse value that you use is not the amount of height that you will go into the air when you launch, it’s just an impulse that might take physics (mass, gravity, etc) into account to determine how much in space you travel. I would say that you first need to print the distance it calculated to make sure it’s correct, after that you might need to figure out the right float multiplier for the impulse to work on each different case since the character and the gravity doesn’t change. Say you’ve experimented a bit with the values and you found that the ideal multiplier is 1.5, then even if you are jumping from 2 meters or 5 meters if you multiply them with the 1.5 it should give you the boost you need.

Indeed this is super helpful actually. I mean, it makes more sense considering the physics values in consideration. Just thought it was possible to kind of constraint the impulse :stuck_out_tongue: .

Good to know :slight_smile: