Mario-like Jump

So, I am working on a game which has physics. I want the player to fall faster after jumped (using rigidbody2D.AddForce method and let the physics engine do its job). I want to make it like how Super Mario does the jump. Currently, when I add force to the body, the hang time is too long and I want it the fall faster.

I also tried changing the gravity scale, it does the job right if my object is standing still. If I move the object to the right then jump, change the gravity scale, the right force is not enough to push the object thus the object velocity x becomes 0 and y becomes higher.

I want to make it like the sample from this website (please choose Super Mario icon) to see what I am trying to achieve.
http://excitemike.com/JumpingControlTester

Thanks!

I can’t check if this will work since I am away from my workstation, but perhaps you could try adding mass to the object somehow after a jump is performed, and once it is grounded set the mass back to normal? Not sure if this will work, but its worth a shot! You could also try adding force to the top of your character to push it towards the grounded faster after reaching a certain height.

From the looks of the charts drawn on that website I would recommend using kinematic rigidbodies and faking physics (adjusting velocity manually) for best results. It will be easier to achieve the cartoony jump mechanics this way than fudging physics systems. Plus you wouldn’t want to move around your platformer game character using forces anyway.

I also tried that but it doesn’t work the way I want it to work. Thanks though.

That’s cool. Let me try that. Can I also make the Physics2D gravity settings to {0,0} and fake the physics? Thanks!

if you using velocity you will have a problem with collision, like me

i still havent the answer for this problem

i dont know why unity havent a video exemple to show us how make a jump like mario with perfect collision, 60% the questions here is about jumping like mario --’ with a good collision and we still have not a answer

@shelltraywnd: Hard to really see without having the project but it seems you’re setting the velocity directly therefore you’re constantly pushing the object against the walls overriding any velocity changes caused by the gravity.

Don’t forget, when you set velocity directly, you’re taking over control of velocity changes made by the physics system.

1 Like