Mega Man-style inverse gravity for platform behavior

Hello everyone, I hope you’re doing well.

I’m opening this topic to request a new feature for the Platformer behavior: an inverse gravity option similar to what can be seen in some Mega Man games.

This feature would allow the gravity direction to be reversed while still working correctly with diagonal platforms. Ideally, it could be implemented in two possible ways:

  1. As a built-in option – Adding a checkbox in the Platformer behavior settings for a given sprite to enable/disable inverse gravity.
  2. As an extension – Allowing developers to trigger inverse gravity when a certain condition is met, without requiring manual adjustments each time.

In addition, it should be possible to switch gravity by inverting jump values from positive to negative, provided this can be done in an action that is continuously active rather than only once. This is important for platform games where gravity changes frequently between low, normal, and high settings—similar to how it works in various Mega Man stages.

The goal is to let developers reverse gravity via a key press, a timed interval, a collision event, or other triggers, regardless of whether the player is on the ground or in mid-air.

Currently, GDevelop does not provide native inverse gravity for the Platformer behavior. If you try to change gravity values from positive to negative in events, the player moves upward but cannot jump while on the ceiling. At some point, the player may even shoot upwards through collisions. Also, when reversing jump values, the change only takes effect after touching the ground, which defeats the purpose of having gravity changes in mid-air.

I’m aware of the existing Flip Gravity extension made by VegeTato, but it has several limitations:

  • It only works as a one-time action, making constant gravity switching difficult or impossible.
  • Jumping feels imprecise compared to the default jump.
  • It depends on a specific key press to work, and modifications to trigger it via collisions or automated events don’t function correctly.
  • It only works with backdrops and not with tilemaps for some reason.
  • It does not support diagonal platforms, even if the maximum slope angle is modified.
  • If activated in mid-air, it works only once instead of allowing multiple activations as needed in games with frequent gravity changes.

For reference, I’ve attached a GIF from the Mega Man engine by N64Mario made in Multimedia Fusion, which demonstrates the kind of inverse gravity I’m requesting (including collisions, diagonal platforms, and key activation). Another good example can be seen in Mega Man 5, specifically in Gravity Man’s stage, where gravity is reversed by collision triggers, and during the boss fight, gravity changes at intervals.

I hope this request will be considered for future versions of GDevelop.

Thank you.
ReverseGravityMegaMan

3 Likes

https://wiki.gdevelop.io/gdevelop5/extensions/flip-gravity

I’ve tried that extension several times, but as I said in the post, it doesn’t work for the type of game I’m making (Mega Man games). Even though I’ve modified the extension’s internal events, it still doesn’t work in Mega Man-type games.

I once made spin to win logic for someone
Like you spin while room
BUT it was meant for smooth spin not instant

HOWEVER it almost works for what you need i just miss something obvious
I put all platforms expect GroundTile2 into Platforms group

And now i can spin them around it

Press RMB to spin/flip it 180°
Press tilde to reset scene
However it like de sync idk why

Maybe someone else can pick up or will be able to come up with other solution

I just tried that and it’s still not the reverse gravity I need. The entire stage flips over and if I turn the camera upside down, the player flips over with enemies and everything, which shouldn’t happen. Well, in Mega Man 5 there are enemies that flip over with reverse gravity, but what I’m looking for is for only the player to flip over, not the enemies. Furthermore, if I flip the entire stage, it would cause an imbalance in the stage, and some objects and gimmicks would not work properly. Also, when I tried that game you attached, pressing several times to flip the stage reaches a point where it doesn’t work and everything gets messed up.

Ow so i totally missed your idea here
Then i have no clue what else than flip gravity behavior could achieve it

@AbsoluteWarner
This is such an interesting request, but at the same time so niche that I don’t think it will be implemented into the engine any time soon, at least not by the devs. Maybe as an extension from a dedicated member. Still, would be cool if they add it.

I think you can somehow manage the thing you want if you mess with the gravity on the platformer character behaviour along with some force shenanigans.

Below a terrible try that I did in some minutes. (Don’t use it as an example)

Screen-Recording (2)

gravity
i tried this - i had to create a platform behaviour…

that horizontal speed action on landing should be set to 0

If you want to rotate the layer - set the camera angle to player angle
gravity2

@petlimpet
hey! a few of months ago i was workin on a gravity-flip game project like this, but I couldn’t quite pull it off so I took a break from it. i even made a post about it here :))
i’m back at it now though, and i just saw your comment , i’ll definitely try your method but if the project’s still around, could you maybe share a screenshot of the variables too?