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.
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.
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.
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?
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?
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.
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!
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).