Skill Tree Activated

The quest to become an indie game developer

#100DaysOfCode#100DaysOfGameDevC#Illogical BaconPanic RoomScript-writingUncategorizedUnityVisual Studio

Grid Overlay Started & ToggleVisible

D44 #PanicRoom

I started work on the Grid Overlay system. I want to have a Grid that gets projected over the House Map that shows where all the Tiles are being placed more easily. I envision the grid following the Floor Tile placement and being a map of my Columns and Rows from the HouseBuilder script. I want to not only project the Grid, but have it labeled to accurately show which Column and Row are where.

the groundwork for the DevTools script

I spent a lot on time working out various solutions, but couldn’t get anything to work the way I wanted it to. Debug.DrawLine() was good for making a line quickly, but would only work in Unity Edit Mode and I want my feature to be a part of the game itself for future debugging use after builds start happening. I thought I would use a LineRenderer component, but that proved too hard too implement in my use-case scenario where I want to produce so many lines and want to keep it limited to a small number of Prefabs that I can Instantiate as needed. That’s when it dawned on me, if I am instantiating a Prefab as a GameObject then I should be able to manipulate it as such. Going about it in this manner proved to be quite fruitful and I started getting results, but only had so much time to devote to it for today.

While working with my Grid Overlay system, I realized I wanted to be able to toggle it off and on. To this end, I knew I would need a new Script to attach my Grid Objects that would allow for this. I decided to use the G key for the toggle and with a few lines of code, got this working. If only getting the Grid to display properly was this easy!

ToggleVisible script

R2D09 #100DaysOfGameDev
R2D14 #100DaysOfCode

Leave a Reply

Your email address will not be published. Required fields are marked *