Flipping gravity in a platformer - odd issue

Get help using Construct 2

Post » Mon Oct 09, 2017 6:31 am

Message: zill can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
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: https://zill.s-ul.eu/ZjyC825p

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

Any and all help would be greatly appreciated :D

Thanks!
B
2
Posts: 5
Reputation: 160

Post » Mon Oct 09, 2017 7:17 am

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: https://www.youtube.com/watch?v=7rolRNnnvyc
B
43
S
15
G
11
Posts: 159
Reputation: 8,779

Post » Mon Oct 09, 2017 7:47 am

Message: zill can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Waltuo wrote: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: https://www.youtube.com/watch?v=7rolRNnnvyc


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!
B
2
Posts: 5
Reputation: 160

Post » Mon Oct 09, 2017 8:00 am

No problem, happy to hear you got it sorted out :)
B
43
S
15
G
11
Posts: 159
Reputation: 8,779


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests