When I click/touch somewhere I want to create an object. However, these objects have to be aligned with each other. how can I do that?
I prepared a gif file as an example. Here I used "Touch.X and Touch.Y". So wherever I click it creates the object there.
SAMPLE GIF
You need to be more specific when you say align.
Do you want a grid, or just along the same axis? Not overlapping? Offset?
Yeah.
Develop games in your browser. Powerful, performant & highly capable.
I want a grid
A possible formula would be int(touch.x/n)*n.
N is the size of the grid.
drive.google.com/file/d/1gHKlcbATTdlT6jD0zTTJOotZEYKwgqrj/view
That was exactly what I was looking for. thank you so much