Flipping gravity in a platformer - odd issue

  • Hi everyone, first time here

    I'm creating a platforming game that incorporates swapping gravity to get around obstacles and enemies for a school assignment

    I've run into a pretty big issue with the gravity swapping mechanic - when i press the dedicated button, the player gets stuck in the terrain underneath him. If i jump, then swap, it works completely fine. Here is a gif in action: zill.s-ul.eu/ZjyC825p

    Here is a photo of the event sheet incharge of all this zill.s-ul.eu/5MKKojuG

    Any and all help would be greatly appreciated <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy" />

    Thanks!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi, welcome to the forum!

    I can't open your links "Secure connection failed" error), but if I had to guess it sounds like this might be caused by the player sprite rotating and having it's origin at the bottom instead of center (resulting in the rotated sprite somehow getting stuck inside the solid floor, before it can rise up by gravity). You can either try using the "Push out solid" behavior on player, set the origin point of player sprite at center (or rotate around the center of sprite/set position on rotation), or on gravity flip set the player character Vector Y to a negative value (-500 or something depending on what you need) to help prevent sprite getting stuck.

    But again, not being able to open the links this is just guessing and hopefully giving you some quick ideas to try:) Maybe someone who can actually view the links is able to help better.

    Also, this might be helpful to you:

  • Hi, welcome to the forum!

    I can't open your links "Secure connection failed" error), but if I had to guess it sounds like this might be caused by the player sprite rotating and having it's origin at the bottom instead of center (resulting in the rotated sprite somehow getting stuck inside the solid floor, before it can rise up by gravity). You can either try using the "Push out solid" behavior on player, set the origin point of player sprite at center (or rotate around the center of sprite/set position on rotation), or on gravity flip set the player character Vector Y to a negative value (-500 or something depending on what you need) to help prevent sprite getting stuck.

    But again, not being able to open the links this is just guessing and hopefully giving you some quick ideas to try:) Maybe someone who can actually view the links is able to help better.

    Also, this might be helpful to you: youtube.com/watch

    Oh my, you're a life saver! The origin point for the sprite was set at the bottom. I moved it back to the middle and it worked just fine!

    Thank you so much!

  • No problem, happy to hear you got it sorted out

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)