Negative Gravity and Ceiling platform

Hello everyone
I started to use GDevelop a few days ago. I wanna make a simple game in which you can change the gravity of a player (Sprite) and move it through various platforms.
I added a button that, when i press it, will change the player gravity (for example -100) and add a force to move it up.
I also added a ceiling (Sprite - Platform) to stop the player when it reaches the ceiling from bottom to up.
The problem is that the player stops for a few seconds when hits the ceiling, but then continues to go up throug that platform.
How can I make so when the player goes up (with negative gravity) to stop (to not goes through ceiling) and to can move it horisontally, but to keep the negative gravity so the player can go up when i move it in the left/right margin of the ceiling (platform) and escedes it?
Any tutorial or example?

Thank you.

Hi,

if you use physics automation to do this it should be quite easy. You can set your character as a physics object and set platforms as static objects and they will stop it moving it.

You can read about this here: wiki.compilgames.net/doku.ph … lt_physics

Thank you for the answer.
I tryed but it doesn’t work.
I set the ceiling Static object and the Player has physics automatism.
When a button is pressed i set :

  • Apply to Player force 1 at angle -90
  • Do =-300 to the gravity applied to Player

But after 3-4 seconds the Player goes up through the ceiling-platform. I think it is because the force keep pushing the player to Up.
Not know way it is not working. Any ideea how to make the player stay below ceiling, and negative gravity?
I attach the gdg file.
g2.gdg (22.8 KB)