Sprite instance animation does not play if outside the screenview

Hi everybody,
I’m making a platform with a dynamic similar to Donkey Kong. I have enemies throwing stones from the windows of a building.
The ones in the screenview play their animation and the stones go down (the stone sprite is created when the throwing animation end).
The upper one (that can’t be seen) remain paused and no stones fall down.
After many test I realized that the sprite can change between its animations, but it can’t play them.
When my character climb the building the enemy starts working with no flaws.
Is it normal that sprites don’t animate outside the screen? Gdevelop 4 didn’t have this problem.
Thank you in advance.

When sprites are outside the screen they are hidden for performance (Why would you render something invisible to the end-user?), maybe sprites don’t animate when hidden?

I’m confused…
I guess there must be a tolerance of space outside the screenview to animate sprites that interact with player or in-screen areas.
I don’t know how to solve the enemy dynamic I’m using (enemy throw—>create stone instance—>move stone instance toward player).
Is there a way to constrain an instance to start its animation?

It might be possible to manually animate an object using timer and setting their frame/looping manually using a variable. You might need to pause the actual “animation” of sprite object itself.
I’m still curious though, do the stones not animate when they come into the screen? That’s interesting.

That should work. My priority is to make enemy animation sinchronized with the throwed stone when player climb the building and the enemy from hidden became visible.

Actually the stones are simple sprites not animated but only moved with a force.
Mmhh… Now that you make mi think they may be better looking with an animation :tired_face:
There the chance that an animated stone starts its animation once it enters the screenview?

I solved the problem creating an instance of the stone with a timer sinchronized to the enemy timer.

1 Like