Hello ,
I suggest you design the grid lines in your 2d software and import the 2d sprite image into unity and finally create a material with the 2d image and add the material to a plane or quad
Typically, you’d do this with a 2D array in C#. Bolt 1 doesn’t handle arrays natively but there’s a community made extension for multidimensional arrays in this link: https://github.com/LifeandStyleMedia/UAlive/releases/tag/1_3_1
Import the package, then run Tools/Bolt/Build Unit Options. After that the multi array units should come up in search.
But then he can’t use it for gameplay, it’s just visual. Or are you suggesting divorcing the visuals from the game systems completely?
Yes. i felt the same way. I’m learning Bolt too, and it’s much easier. I worked with the above equation before and was trying to firgure how to do it in Bolt, and it is so much clearer and easier to understand thanks to you asking this question. So here it is:
you can change the size by changing the “Last” values, and can plug in an “integer variable” for them to access them in the inspector. If you have more questions ill be happy to answer.
Oh jeez, that sounds complicated. Would you use Text Mesh Pro…how would you do that?
Great idea…How to execute? Let me talk to the rubber duck. Seems like we set the name of the instance after we create it. How do we set the name of an instance…must search through integrated docs it seems…
Another for loop…where to put it? add “Gameobject set name” unit after instantiate
This is why you need a 2D array from Jason’s extension here which lets you get a grid cell based on X,Y position and then do whatever you need with it, including renaming.
You’d then need to extend sinjinn’s graph. Create a new 2D array before the for loops and add the instantiated grid cell to the created array so you can retrieve it later and do something with it.
The screenshot below shows code for generating a 3D array of game objects and renaming them according to their x,y,z values. Use String Literal nodes and add the index of each for loop to get the full name which is then set via Name(Set).
Further off screen in the macro the new game objects are also stored into a two nested AotList. Using three List(Get) in a row (each one’s int value set to the desired index) you can set your cursor to any one specific game object in the array. For example: List(Get) 1, List(Get) 7, List(Get) 4, would return the cube generated at 1,7,4 from the 3D list array.
This code works the same for a 2D array, you just use one less for loop. Either way you don’t need to use any other extensions. If you want to access the 3D array in other macros just save it as a variable with Variable(Set) and access it with Variable(Get). Easy Peasy.