Collapsing platform not behaving as expected

I have a set of collapsing platforms (code below for them and for my sprite walking). If my character walks straight across them they collapse as expected, if they jump up and down on them it works too, standing still on them also works - the problem is if I change direction whilst walking or jumping on them they stop working and I either have to jump or walk off then on them for them to trigger again.

If it helps to explain. The longer you stand on the platform the more it collapses within a given time. If you jump on then off they’ll only be partly broken. Like the dissolving floors found in Manic Miner.

Help appreciated. I’ve read the Wiki guides and watched numerous videos but I can’t find the answers to what I’m missing.

Worth noting that all the “CollapseWait” timers are reset at the start of the level.

Can you explain why are you getting the Y position of the “gamer”.

To make sure he’s stood on top of the platform.

I don’t see why changing direction would affect the shown events, unless perhaps if there’s something wrong with the animation of Gamer, like sprites of different sizes.
Maybe you can duplicate the scene, remove all the extra and check if the problem still occurs, and if it does, share the project with us.

The sprites are all the same size, so it’s not that (I saw that as a possible issue on this forum a while back so I’d made sure to size correctly at the start).

I’ve stripped it right back and made a test level and the behaviour still happens.

Here’s an upload of my test:

You forgot to mention that you use custom controls.
You should avoid mixing standard position events with position behaviors, it creates conflicts. I suppose this is the issue here, because if you enable default platformer controls, it works fine.
And please stop the copypasting, object groups are great for such things. :+1:

1 Like

Thanks for that. I couldn’t quite get my head around groups but your capture has helped me out on a few bit for my game that looked a bit bloated.

The problem now is why I went to custom controls (I’d totally forgotten). My character should NOT be able to move about when jumping (you jump forward you have to ride it out jumping forwards until you land). I’d got the information from here (Solved) Stop movement in the air?. Is there a way to stop movement in the air but still use the default controls?

You can do pure custom, or you can alternate between default and custom, just don’t use both at the same time, I guess.

Damn. There’s no literature I found to say it wouldn’t work. I fixed one issue only to break the overall game mechanic. I don’t understand why with custom controls it doesn’t see it’s on a platform. Surely that’s just sprite collision? Complaining won’t change what is, I guess! Do you have any suggestions how I can overcome this?

Do pure custom or alternate between both, as written above. :thinking:

I was hoping for a little more guidance. Which bits in particular don’t work with custom? Is it the contact with the platform (Gamer is in contact with Collapse)? I don’t claim to be a coder, which is why I’m using GDevelop. I’m a graphic designer. I don’t quite understand why it doesn’t work either way.

I’m a graphic designer, too! I’ve been learning GDevelop for the past two years…it’s quite something lol.

If I’m understanding you correctly, try using default controls (no custom) and then try something like:

Condition: Gamer is not on the floor
Action: Ignore default controls for Gamer

I think that will make Gamer able to move forward/fall, but any input from the user will be ignored until Gamer is back on the ground. But, you’d have to test it out to make sure.

As for object groups, in your Object Groups Panel you can take multiple objects and put them into a group. So, you could take CollapsingFloor1, CollapsingFloor2, etc and put them all into a group (and call them something like “AllCollapsingFloors”). Then, in your events, you would just need one Condition/Action that references the group instead of having 5 separate events for 5 different floors.

Hope this helps a little bit getting where you want to go. :slight_smile:

1 Like

Thanks so much!

I tried “Ignore default controls for Gamer” but was using “Is Falling” and “Is Jumping”. Just tried your suggestion and, with a jumping forced movement contingency, it works perfectly! :grinning:

I guess this is the perfect platform for graphic designers as it’s easy to actually see a result and you don’t have to wait on unreliable coders (the project I’m working on has been picked up by two other coders who have just vanished into the ether).