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. 




In this video, they set up a mouseclick movement and they have an isometric 2D tilemap. I'm not really a fan of how the character moves in this video though.



This video talks about using the grid component but I need to explore this more. 

I used this video to test that my animations worked with movement. This is the same tutorial I used for the teamwork practices project so I knew it would work, but it was not the type of movement I wanted for my game. 


These are some documentation I looked at while working on the Character movement, these along with the tutorials I watched were very helpful. 
https://docs.unity3d.com/ScriptReference/Vector3.RotateTowards.html
https://docs.unity3d.com/ScriptReference/Transform.Rotate.html
https://docs.unity3d.com/ScriptReference/Vector3.Angle.html
Unity - Scripting API: Vector3.Lerp (unity3d.com)
This forum in particular was helpful because it used  time/Totaltime for the last part of the moveTowards parameters which worked well. 

This is a video of the progress of the tile-to-tile movement (26/11/23)
I still need to fix the animation timing and to add the rotation.

Comments

Popular Posts