[Solved] Generate and center a dynamic grid of objects

Hi everyone,

I am completely new in this forum and in gdevelop (but not in development)
Also, I used the search function but did not find any related topic.

I would like to create a dynamic grid and center it in the middle of the screen (width and height)
By dynamic I mean a dynamic size ( 2x2 , 3x3 etc) and also having objects dynamically selected from a list of objetcs.

I have installed the extensions: “CreateMultipleCopiesOfObjects” which indeed allows me to generate a grid with a dynamic size based on a variable.
However I am not able to center it, nor to set randomly the objects.

I am probably going in the wrong way, I am not yet used to the “no code” approch.
I am going to think that I will have to compute the (x,y) of each objects “manually” but I am pretty sure there is another way to do it.

How would you do such a thing ?

Thank you very much for your help

I found a solution.
If it can help other gdevelop junior devs like me, here what I have done.

Don’t hesitate to comment if it can be improved :slight_smile:

edit: important detail: the center of the object used in the grid has to be set to (0,0)


It’s very helpful thanks, I’m always looking for things like this.


I know it’s solved but I wanted to share my project. Do with it what you may.

doug13579/Gdevelop-create-objects-on-centered-grid (github.com)

1 Like