Trying to create a skyscraper game but with moving bottom (Capybaras).
so it’s not too hard to stack them on top of each other but when I am trying to add a bit wobbly effect I don’t even know where to start.
basically if I move towards left, all the ones on top should have a little bit delay one by one. wondering if there’s any intuitive logic to make this happen?
since GD doesn’t have UID, can’t just do it one by one from bottom to top.
Also considering if there’s probably gonna be a thousands of them, what’s the best way to just bypass some in the middle but just do the calculation…?
![Screenshot 2024-12-21 at 8.36.55 PM|493x500]
(upload://ggbks9ZwCzPdPMmkuHht2TIFZXz.jpeg)
(concept)
There is an extension to add UID if you need. Or I sometimes create my own system (add a number “Reference” to each new created objects)
About you issue, maybe look at the “joints”. Joint connector - a game example from the GDevelop game making app | GDevelop
I actually made the UID system worked so now every capybara got it’s own id.
but it’s hard when you trying to move them one by one. for certain reason I can’t use repeat.
and when one instance with one UID is picked, under the same condition you can’t pick the same instance with another UID…
I want to write the logic like - If Capybara x moved to the left (Object boolean is true) , then set it to false, pick and move Capybara x+1 .and set boolean to true.
Yes, that’s extremelly annoying. But that’s the core of Gdevelop system

- A condition is also a filter (once you have picked the Capybara with the good UID, you can’t work with the others in subevents)
- You can’t have two objects of the same type interract with each other (take different role in the same action)
We have to think differently.
In your case the action “Pick all instances” might be useful.
Thank you! that’s exactly the biggest problem for beginners. some simple concept can’t be made under this restriction.
I’m trying to figure out if array system could solve the issue but it’s not so intuitive for beginners.
A common solution when you want to have 2 objects of the same type to interract, is to link to each of them another object (on creation) and to give the same UID (or reference). You could call that linked object “Shadow”.
Then, you iterate every “shadow”. For each of them you check if its linked “Capybara” move to the left. If so you perform your action (set to false), Pick all instances, then select the “Capybara” n+1 and perform your action (set to true)
This is the first thing I would try. The array could contain the X positions of each object in the stack. Each tick you would “propagate” the values through the array. The first value is always the X position of the bottom object. So as the object moves, the new X values are being pushed down the line resulting in a gradual sweep through the tower.
One problem with this would be if the bottom object moves fast enough, it will not really look like a tower moving since the jump will appear through the entire stack. And, it won’t sway beyond the target X position. But it’s a start 