Ask here your questions to get help using GDevelop.
By AnimatedG
#64566 Hi Oscar Erni,

I'm a newish user myself. Hope this works for you. If you want for example for the rocks to be triggered at 100 of X position. You will want to make it greater than or equal to 100 on X position

On condition - All Objects - Position - Compare X position of an object (eg. >= 100 of object[player])
action - (Trigger falling rocks)
By Oscar Erni
#64569 :D thank you very much .....
the rocks doesn't fall down... how do I apply gravity on rocks to fall down....something like this.. if the player is approaching on designated position, the rocks will suddenly fall down ( be alerted and the rocks will fall down..)
By AnimatedG
#64570 Hi Oscar Erni,

I have not really tried out using behaviours so i could be wrong. But i think you can add gravity to the rocks by:

Right clicking on the rocks (possibly have to be in the scene) - add a behaviour to an object - physics engine

Next select the rock and in the properties panel (where the position, scale, z-order are shown). There is now a physics property at the bottom. Click on "Click to edit" There should be options to change the gravity.

I haven't played around with this, so you will need to do some trial and error.
User avatar
By Lizard-13
#64573 As AnimatedG said, you could use the Physics behavior this way:
*Add the physics behavior to the rocks, edit the behavior and put a positive value on the gravity Y coordinate.
*In the events editor, add "At the beginning of the scene >> Activate Physics for Rock: no" so the rocks won't fall at the beginning.
*Now, when you reach a position to alert a rock (X position of player > some value, player colliding with alerting area, etc.) activate the physics behavior for the specified rock and you are done.

If you don't want to add the Physics behavior for such simple thing, you can also do it:
*In a first event, at the beginning of the scene, set a variable "active" for the rocks = 0 (this is an object variable, now each rock has its own "active" variable set to 0).
*In another event, when you reach a position to alert a rock, set the variable "active" of that rock = 1, that specific rock is now active.
*Finally, in a third event, if the variable "active" of rock is = 1 move it downguard (modifying the Y position or through forces), so active rocks will fall down.
By AnimatedG
#64591 Hi Oscar Erni,

Maybe you can try deleting past a certain Y position.

Eg, the floor Y position is 100

Delete rocks when past Y Position of 100. This will only work if all your stages have flat terrain

Alternatively, if the floor is an object itself, you can do
Delete rock - When rock.Y() > floor.Y()

Alternatively, if your floor is not an object. You can create a rectangluar block. Place the block on top of the floor and hide the block. Then when rock collides with block, delete rock