How to spawn random objects at the top of the screen ?

Hello.
First: Sorry for my english, im not a english native speaker
Second: iam a newbie
Iam making a game where i climb rocks that fall down from the sky, and going higher makes you earn more points. My question is: How can i make rocks spawn meanwhile iam going higher? because i already set to create objects in random position, but they just keep spawning at the same place.
Thank you for your time

Add an offset in function of the player position or camera top position, if right now for the spawning Y position you’ve something like:

Random(10) - 10

or

-50

Use:

Player.Y() + Random(10) - 10

or

CameraY() - CameraHeight()/2 -50

Thank you for answering. I changed the Y position, but they keep appearing at the same height.

This is what i made:
The timer “RockCreation” is greater than 1.5 seconds. Action: Create object Rock at position Random(800); Player.Y() + Random(10) - 10.
Reset The timer “RockCreation”

Iam not sure if this is what you were talking about. Good luck with studies.

The event logic is right, don’t worry. The problem is that you’re creating the rocks under the player position, try to create them at

Player.Y() - 600

If the player is at the bottom of the screen and the screen size is 800x600,the rocks will be created above the screen, you can create them even a bit upward, to make sure the user don’t see the rocks being created:

Player.Y() - 650

If it doesn’t work I’ll need an event screenshot and maybe a screenshot showing the problem in-game or a more detailed explanation of the problem :slight_smile: