Ask here your questions to get help using GDevelop.
User avatar
By jack
#70405 I added 3 times the same object with an animation, but they are not in sync. That's the same problem I had at the waterfall.
Is it because I have too many sprites with animations in my scene? There are 35 with all collectibles.
coin.gif (229.34 KiB) Viewed 391 times
By MattLB
#70430 Are you adding the coins in the scene editor, or creating them with events?

If created in the scene editor they should be in sync, but you can check that they are all set to the same animation frame by clicking on each instance and looking at the bottom of the properties window. You could also force them all to the same animation frame in the "At beginning of the scene" event.

If you are creating them with events, then ones created at different times will often be out of sync, because they will be created with frame 0, but existing instances may be on any of the other frames. You could enforce synchronisation by first checking that another coin exists (check number of objects >0) , then use the select random object event and capture its current animation frame in a variable. Then create a new coin and set its animation frame using the variable.

Alternatively, you could create the new coin first, then use a "for each object" sub-event to set all coins (new and old) to animation frame zero to match it.

Some of these will look more glitchy than others.

Oh, and I recognise that player character sprite. ;)
User avatar
By jack
MattLB wrote:Are you adding the coins in the scene editor, or creating them with events?
In the editor, but now I have tried adding with action, the same result.
I found out that the problem only exists if the X position is higher than 5231. Mysterious! :geek:
Now I try your tips.
MattLB wrote:Oh, and I recognise that player character sprite. ;)
Yah is one of the best and famous freebies :) unfortunately no source files included :roll:
User avatar
By jack
#70497 I have created a simple example.
The problem is not the absolute X position but the distance from Player Start to the coins. An action that set the frame to 1 or change the animation, works only if it is very close to the coins. (also not 100% perfect, some have a frame offset) If I run a bit away and come back, the animations are messed up again.
(65.55 KiB) Downloaded 14 times