Setting Up the Grid Values
Last updated
Last updated
Now, let’s take a closer look at the Core Grid Properties section of the Easy Grid Builder Pro XY component. There are three key properties to focus on: Grid Width, Grid Length, and Cell Size.
Set the Cell Size to 1 (1 Unit = 1 Unity unit), Grid Width to 35, and Grid Length to 20. This configuration will fill up your Game view with the grid.
The Update Grid Position property allows you to adjust the grid's position during runtime. If you want the grid to move (update its transform position) dynamically at runtime, make sure to enable this property.
The Grid Origin property defines the grid's origin point, which can be set to Centered or Default. For this tutorial, we’ll keep it set to Centered.
The Update Grid Width And Length property enables runtime changes to the grid’s width and length. If disabled, modifying the Grid Width and Grid Length values during runtime will not affect the grid system. For this tutorial, we’ll leave this property disabled.
This is where you add all the Buildable Objects to your grid. These objects can be placed on your grid during runtime. We’ll explore this feature in more detail later in this tutorial.
Vertical Grids allow you to generate additional grids above the base grid. While this feature is less useful in a 2D game since vertical levels aren’t typically needed, it can still be leveraged with clever design techniques to create unique grids.
For this tutorial, we’ll skip the Vertical Grid Properties and explore them in a future tutorial.
The Grid Collisions section is responsible for generating the base collider for the grid, which defines its physical area.
The Grid Collider Size Multiplier property adjusts the collider's scale relative to the grid size. By default, this value is set to 2, and we will leave it as is.
The Lock Collider At Bottom Grid property is designed for use with vertical grids. When enabled, it locks the collider to the base grid level, preventing it from moving with the active vertical grid level during switching.
For this tutorial, we’ll keep these settings at their default values.
As you can see, there are four more sections available: Visual - Object Grid, Visual - Canvas Grid, Visual - Runtime Text Grid, and Visual - Runtime Procedural Grid. These provide unique ways to generate grid visual representations for Easy Grid Builder Pro 2. You can mix and match multiple methods or choose to use just one, depending on your grid system's needs.
Visual - Canvas Grid was the primary grid visualization method in Easy Grid Builder Pro 1. However, with the introduction of the Visual - Object Grid method, the Canvas Grid approach is now considered obsolete. For this tutorial, we will focus on the Visual - Object Grid properties and customize them to suit our 2D game. This method is enabled by default, and the grid visual you currently see in the scene is generated using this method.
The Visual - Runtime Text Grid and Visual - Runtime Procedural Grid methods, on the other hand, are designed for runtime only and do not have any visual representation in the Editor.