Random background scrolling speed

Hello. Is there a way to make the background scroll at a random speed with time delta?

Hi, there is the RandomInRange function. It would look like this: add RandomInRange(lowest value,highest value) * TimeDelta() .

Will that start at a fixed random speed when launching the scene, or will it change it’s speed at a variable rate after the scene loads?

Edit: I just tried it, and it looks like it chooses a random fixed speed when the scene launches. Thanks for your idea, I was hoping to move clouds at variable rates after the scene launches.

It will have a fixed random speed for the scene. If you want to change the speed randomely during the scene you need a condition. This could be, for instance, after the player reaches a specific position.You could also use a timer. It depends on what you want to achieve.

I see. Thanks for your help. Yeah, I am just trying to move clouds back and forth at variable rates. I’ve never been good with timers. I’m not sure how they work.

In this case I would use a “for each” event. You can give each cloud its own random speed after spawning (although that’s not really how clouds behave imho).

Well, after the scene loads I was hoping to get the cloud to say scroll at 10 then change to 5, then back to 10 again. To make it look like the wind speed was changing.

Then you could do this with positions or with a timer.

How do I set up a timer? Is there a good tutorial? Every time I try, it doesn’t work.

You could look in some of the Gdevelop tutorials. Timers are used by a lot of games, see e.g. here: Road Rider - Endless car game tutorial [GDevelop wiki] or here: Tank shooter - Beginner tutorial [GDevelop wiki].