Thursday, December 17, 2015

Unity Day 48 (Tanks Project)

What I Did:

     This day I am creating the game manager to manage the games game play. The first thing I did was created two empty game object and renamed them as spawn points. And then changed their transform to serve as the two spawn points. Then in the hierarchy I created a new canvas UI element. I added a text component to the canvas and resized the text to fill the screen. On the Text component I set the text to "TANKS!". Then I used the circle=select button to change the Font to BowlbyOne-Regular (Supplied in the assets) and changed the Alignment to center and middle. I then enabled best fit and set the Max Size to 60 and also set the colour to white. After I added a shadow component to the text and set the effect colour to brown. I set the effect distance to (-3, -3) to give it a bolder shadow. I created a new empty game object a named it game manager, that attached the game manager script to it. I then populated the references on the script before editing. I also looked at the already completed tank manager script that will be given to any thank that spawns by the game manager.



What I Learned:

     I didn't learn anything new this session that I didn't already know, since I'm setting up for spawning in the tanks.

What I'm Doing Next Class:

      Next class I will be finishing the game manager and mixing the audio so the game sounds smooth.

Wednesday, December 16, 2015

Unity Day 47 (Tanks Project)

What I Did:

     Today I begun making it so the tank(s) can shoot. The first thing I did was selected the tank and created a new empty game object and named it FireTransform. I then right clicked on the existing canvas attached to the tanks and created a new UI element slider. I deleted the background and Handle Slide Area from the new slider because they will not be needed. I then reselected the aim slider object and unchecked intractable,  set the sliders transition to none and changed it's position. After that I multi-selected the aim slider and fill area game object. In the the Rect Tansform components i clicked on anchor presets and made it so the game objects would stretch vertically and horizontally over the canvas. I then changed the art for the slider and applied a new script to the tank which I edited to tell the game how the tank should shoot and under what conditions.




What I Learned:

      I learned how to spawn and launch a game object from another game object when certain criteria are met. I also learned how to make a UI element stretched on command.

What I'm Doing Next Class:

     Next class I will be creating the game manager that spawns both tanks in and controls how the game should be played.

Tuesday, December 15, 2015

Unity Day 46 (Tanks Project)

What I Did:

     Today I begun the creation of the tank shells. The first thing I did was go into the models folder and grab the shell model and then drag it into the hierarchy. I then added a capsule collider to it and made sure that the collider was checked as a trigger. I also resized the collider to properly fit the shells shape as best as possible. I then went to get the shell explosion object in the prefabs folder and dragged it onto the shell to make it a child. I also added an audio source component to the shell explosion object. I then began editing the script for the shells. After that I began the shell game object still selected I dragged the child game object called shell explosion onto the explosion particles and explosion audio public variables. I then made the shell game object a prefab.



What I Learned:

     I Learned how to make a game object effect another game object with the total effect varying depending on distance and if it's in range.

What I'm Doing Next Day:

     Next day I will be making it so that the tank will be able to fire shells.

Unity Day 45 (Tanks Project)

What I Did:

     Today I began making the tank health bar work properly on its own. I first began by getting the short premade script called "UI Direction Control" and attached it to the health slider game object. I then got the tank health script and attached it to the tank which required coding to complete the script.  This script told the game how the colour of the health bar should be handled depending on the value of the tanks health, it also handled what it means for the tank to be dead and when it should and shouldn't be dead.. After completing the script I added the required references needed to make the script run properly.



What I Learned:

     I learned how to make a UI element change its colour depending on its value.

What I'm Doing Next Day:

     Next Day I will be adding the tank shells that will later be shot by the tanks and will deal damage to the opposing tank.

Friday, December 11, 2015

Unity Day 44 (Tank Project)

What I Did:

     This day I set up the camera, by creating a new empty game object called camera rig. I then dragged the main camera on to it making it a child object of the new empty object. I had the camera rig rotate and the main camera normal rotation, and lifted the main camera up so it was looking down at the game again. I then added an already completed script that was given to me to the camera rig which makes it do everything it was supposed to, which I think was stupid to do and the half hour spent explaining what it does could of been used to create the script. After watching half an hour of explanation on a script that wasn't really that hard to understand I started work on the next tutorial which was making the health for the tank. I started this by creating a new slider game object from the UI section of the hierarchy create. I then Deleted the slider handle as it isn't meant to be interacted with by the player. I then unchecked intractable to make sure it couldn't be played with by a player. After that I resized the entire UI to be fit square around the tank. I then changed its shape to the health wheel sprite that was given with the project.



What I Learned:

     I learned how to set up a basic UI object that is in the actual 3D world and is attached to an object such as a player.

What I'm Doing Next Day:

     Next Day I will be adding code that will make the health bar change colour as it goes down, and the way it will function.

Thursday, December 10, 2015

Unity Day 43 (Tanks Project)

What I Did:

      Today I unity 4.3 was released so I spent today installing it which really just consisted of me sitting here waiting for it to finish, but i did finally install! So next class I will do what I said I'd do this class in my last post.

Wednesday, December 9, 2015

Unity day 42 (Tanks Project)

What I Did:

     This day I wrote the code for making the tank move, and listened to a lot of explanation to what the code did since this tutorial is intended for teaching all levels of unity knowledge.

This is the code that was typed which is telling unity how to move the tank and when to play certain sounds.



     This is the final product of the tank after this tutorial, which now moves and plays the engine sound depending on its movement state.


What I Learned:

     I learned how to make a  game switch an audio sources depending on what the game object they're assigned to is doing.

What I'm Doing Next day:

     Next day I will be making the camera move properly with the tank(s) that will eventually be in the game.

Monday, December 7, 2015

Unity Day 41 (Tanks Project)

What I Did:

     Today I began working on the tank. I began by dragging the tank model into the hierarchy. I then added a rigidbody component and a box collider to the tank. I adjusted the collider to fit the tank as best as possible. After that I added 2 audio source components to the tank, the first I added the idle engine sound and the other I left blank. After that I dragged the model into the prefabs folder to create a new prefab. I then grabbed the dust particle effect and dropped it on to the tank model. I duplicated the particle effect and changed their positions so it looked like the tank treads where creating the dust effect when they moved. After that I added the movement script to the tank model by dragging and dropping it on to the model. I stopped here during the tutorial as I was running out of time.



What I learned:

     I learned how particle effects that become active during movement work.

What I'm Doing Next Day:

     Next day I will be adding the code to make the tank move.

Friday, December 4, 2015

Unity Day 40 (Tanks Project)

Update:

     I spent the last few classes trying to figure out why the nav mesh won't generate properly and couldn't find anything on it and since it was driving me crazy I decided to take a break from that and do the next project in the mean time. I'll probably restart the survival shooter project when I'm done with the tanks project.

What I Did:

     To start off the project I created a new 3D project named Tanks. I then imported the game assets from the asset store into my project. After that I dragged the level art prefab into the scene. I then had to delete the default lighting since the level art came with its own lighting. I then went to window and selected lighting to change some of the settings. The changed I made where setting the ambient source to colour and changing the colour to a dark blue. I then Changed the cameras position and set it to orthographic view from perspective. I then changed the main camera's background colour to brown.


What I Learned:

     I learned how to change the background colour of the scene and how to change the colour of a scenes lighting.

What I'm Doing Next Day:

     Next day I will be adding the tanks and giving them their controls to move.