Jump after picking up an object

I want to make a cube or something and when you step over it, it says “Press “P” to pick up superjump” and if you press “P” then the next time you press spacebar (my jump) you jump say five times higher, I know this is confusing but any help would be great thanks!

Declare two var in your player’s script, jumpForce = 5 and jumpForceBonus = 0. THe name and value aren’t relevant, except the 0 and the logic behind. When you jump, you add a force Vector3.up * (jumpForce + jumpForceBonus) * Time.deltaTime.

Ok, now, when you pick the bonus, you can modify the jumpForceBonus value, which will allow you to do a super jump.