- Home /
Prefabs with sprites, make them all same size
Hi all
I want to create a script that will generate content as the game (2d game) goes on and i wanted to have a grid and its cells populated by prefabs ( e.g prefab "Ground1" , prefab "2 little platforms" prefab ("wrecking ball"). These prefabs will be sprites with colliders , some maybe with rigidbodies.
How can i make sure that all these prefabs will have the same size (fit in a cell of the grid)?
P.S the sprites dont have to be the same size , just their countainer. For instance the 2 little platforms would populate less space that "ground1", the rest would be filled by backgrounds etc.
$$anonymous$$ake the GameObject with the Sprite a Child of the actual thing (block whatever). This way, the sprite can change in size, but the parent won't
Yeah i am not so sure about how i would do this (set the size of the main gameobjects)? Colliders are not a good option, i was tryin to find something from unity, otherwise i was thinking to just give the main gameobjects 4 points relative to them that are their square coordinates. Would that work?