To do list
1.Environment
Arena
Towers
2.Player Units (3D Models,)
Tank
Soldier
Archer
Air
3.Enemy Units
Tesla Towers
Inferno Tower
Bomb Tower
Mother ships/ Fat jets
4. Player’s Spell
Freeze
Damage
5. 2D artwork (For Every unit)
To do list
1.Environment
Arena
Towers
2.Player Units (3D Models,)
Tank
Soldier
Archer
Air
3.Enemy Units
Tesla Towers
Inferno Tower
Bomb Tower
Mother ships/ Fat jets
4. Player’s Spell
Freeze
Damage
5. 2D artwork (For Every unit)
30th/ fixing bugs
I did manage to correct most of the bugs from last session. I added the audio, that would constantly play the game and change in different scene. next I was preparing for audio on/ off button. But for some reason I ended up having bug in my game.
Fixing Errors and bugs
As I was trying to balance cards on Unity I did some changes that disconnected all my work mechanics in Unity. The min reason was the script being misplaced. Also while adding the sound on different scene for game play, I encountered conflicts within scripts and all my particle effects were acting weird and were not in one place. I assume that's what happens when script errors occurs.
I have been contently in touch with the Tutor Joe for further help. and I was finally able to zip my files and send it to him. I also had many conversation on discord where I shared all the images/screen shots on problems regarding game.
I was also saving my work while I was working, is a good practice. However increment and saving would save me from having this issue. For me as a Intermediate game student. It's hard to get stuff right. I am very grateful to have Joe as a Unity Tutor who's a beast at coding and game making. I wish I could code like him one day. :)
It is easier to be discouraged when things goes wrong. Figuring out the issue, consulting with seniors would eventually fix the thing. Also Thanks to Tutor Chris for extending due date for assignment submission, where I could polish my game nicely.
Creating animation keyframes inside Unity.
Instruction Section:
It is a new experience for me to do key frame animation inside unity which is more similar to after Effects and other software. I did manage to give some basic instruction on how to play game as its a part of assignment. Hence, I created a new scene called 'Instruction 'and created some text for each text and animate them, I mainly tweaked some position, scale and rotation values for its dynamic result. One thing to keep in mind is that when we press record button, the key frames are automatically put on the first frame of any animated source. This took me some time to figure out as it was not functionally well.,
Base Layer in Animator panel. right click and make selection to hover over different functions/tab, eg: hello, exit as shown in the picture.
Also different function have their own properties bar. where we can adjust its overall speed, offset values.
As my key frames were very fast, I did manage to change its speed by 0.3 times. and It appeared fine.
Coding:
One of the best part of gaming making is coding, with which results are easy to achieve, for me the basics on coding got quite interesting as I carry to revise them thoroughly.
Some of the basics code that I felt easy were, buttons for scene management, providing options for character like health, attack, destroy, time frame etc. But Some were quite challenging for me to set up by myself which were written by game tutor, Joe.
Here are some of the sample of coding that we did which can be handy for future use and learning.
*Scene management
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class MainmenuScriptExit : MonoBehaviour
{
public void MainMenuBtn ()
{
SceneManager.LoadScene(0);
}
}
*Destroy
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Destroy : MonoBehaviour
{
public void DestroyObject()
{
gameObject.transform.position = new Vector3(0, 0, 1000);
if(gameObject.name == "cpuKT")
{
GameObject.Find("GameController").GetComponent<GameController>().gameWin = true;
}
//Destroy(gameObject);
}
}
* Canon shoot( I use this to shoot users units,
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class cannon : MonoBehaviour
{
public List<Transform> unitsInRange = new List<Transform>();
public float distanceTo = 99999;
[SerializeField] public Transform target;
private float turnSpeed = 1;
//Shooting variables
public float shootWaitTime = 1.5f;
public float shootTimer;
[SerializeField] private GameObject cannonBall;
[SerializeField] private Transform spawnPoint;
private void Update()
{
if(target == null)
{
FindTarget();
}
if (target != null)
{
Vector3 targetDir = target.position - transform.position;
float step = turnSpeed * Time.deltaTime;
Vector3 newDir = Vector3.RotateTowards(transform.forward, targetDir, step, 0.0f);
Debug.DrawRay(transform.position, newDir, Color.green);
transform.rotation = Quaternion.LookRotation(newDir);
if(Time.time > shootTimer)
{
shootTimer = Time.time + shootWaitTime;
Shoot();
}
}
}
public void FindTarget()
{
foreach (Transform t in unitsInRange)
{
float distance = Vector3.Distance(gameObject.transform.position, t.transform.position);
if (distance < distanceTo)
{
target = t.transform;
}
}
}
void Shoot()
{
GameObject go = Instantiate(cannonBall, spawnPoint.position, Quaternion.identity);
go.GetComponent<cannonBall>().target = target;
}
/* private void OnTriggerEnter(Collider other)
{
if(other.tag == "unit")
{
unitsInRange.Add(other.transform);
}
}
private void OnTriggerExit(Collider other)
{
if (other.tag == "unit")
{
unitsInRange.Remove(other.transform);
}
}*/
}
Joe recently game me a sample of a game that I was after. It worked perfectly.
This is my audio file that I got for free on web. It sounds very old which matches my game theme.
Percy_Wenrich_-_02_-_The_Smiler_1907_Zonophone_Concert_Band
Assigning audio is easy unity, just need to add component/audio source and assigning audio file to the source.
For this, I watched lots of tutorials on YouTube which helped me for some extent.
Animating In Maya, rig, bone, deformers
When Modeling giant, Golem, Barbs for my game. I realized that how complex these round shaped character are to model.
My first rig looks like this,