25/10/23+ Unity Tutorials
Below is the process I went through to create the movement script I have so far.
25/10/23
Create a grid in Unity - Perfect for tactics or turn-based games! - YouTube
I watched this video which provided the basics of creating a script that creates a specified number of tiles, centres the camera on the tiles, makes the tiles checkered (using the colour) and a few ways to interact with the tiles. This tutorial was for 2D so I had to change a few things to make it work for 3D, there were also some things that might not be necessary for my game but it was helpful to get a perspective on how to create and use tiles in this way.
I used game objects instead of tiles and needed to change the y in the script to z (due to my game being 3D), I also had to figure out how to use the materials instead of colours for the checkerboard part of the script. However, after searching the init method (which I had not seen before) I think I will have to figure out a different method if I wish to have checkered tiles (I think it could look interesting randomised).
unityscript - How do I change the material of an object with Script in Unity? - Game Development Stack Exchange I looked at this page on how to change the material, but I think I will have to look at some more sources to get it to work with the other script.
[16/11/23 :
I added a function to the script from the tutorial to alternate between 2 tiles (with different colours) However, I'm not sure if this is the best method for setting up a tile grid.]In this video, they implement grid movement using a Coroutine, however, in the comments, it says you can do the same with MoveTowards like used in the video below.
https://docs.unity3d.com/ScriptReference/Transform.Rotate.html
https://docs.unity3d.com/ScriptReference/Vector3.Angle.html
Comments
Post a Comment