My 70-day journey learning Unity

Notes from each day chronicling exercises completed, concepts practiced and learned, mistakes made and breakthroughs celebrated

Unity Day 1

- Started with Learn — first Mission

- Created a UnityID

- Watched a video

- Learned about the plans

- Downloaded and installed Unity Hub

- Watched an inspirational video, ‘My First Game’

- Chose the LEGO microgame

- Launched Unity

- Completed 3 Microgame tutorials

Learned about:

- Game objects

- Play testing a game

- Updating a game object’s property

- Adjusting the stage’s camera

- Added a game object to the stage

- Moved, rotated, positioned that object

- Discovered different modes of building in LEGO’s microgame

- Added functionality and triggers

- Saved and play tested

Editor panes introduced:

- Hierarchy

- Scene

- Inspector

- Project

Unity Day 2

- Started where I left off: tutorial to add an enemy

- More behavior and trigger bricks with customizable Inspector properties

- Screwed up placement of a brick, had trouble moving it thereafter

- Next tutorial I crashed Unity by trying to Undo too many times rapidly

- My progress seemed gone: I couldn’t reopen the project

- I re-downloaded it

- I re-completed each tutorial already done

- I successfully completed the ones I hadn’t

- I made one mod: Speak action

- I built and published the game…except that I saw errors and a blank page upon completion of the build process

Editor panes introduced:

- Publish

Learned about:

- more Action and Trigger blocks: shoot, explode, detonate, speak

- Mod community

- Common pattern: click and drag asset onto scene, move around scene to position, click to inspect and customize, click play to test

- the importance of continually play testing after each change

- Not getting mad or bummed if a project crashes

- Avoiding quick or multiple undos

- the importance of being careful when dragging and positioning assets in the scene

- avoiding clicking random assets in the scene…when I am used to clicking and dragging to pan the view

- holding alt and command to adjust and pan the view of the scene

Unity Day 3

- Tons of inspirational videos

- Each one stressed that I shouldn’t stress about using Unity

- Several resources to learn and practice Unity

- Unity Hub

Editor panes introduced:

- Packages

- Unity Hub

Learned about:

- navigating a scene: pan, move, focus, fly around

- possibility of customizing the editor…one day

- Packages

- Managing installs of Unity in the Hub

- Starting with the right template when creating a project

- how important the Hub is for all things Unity

Unity Day 4

- Completed FPS Microgame

- Downloaded, imported free assets

Editor panes introduced:

- Import asset manager

Learned about:

- Scenes

- GameObjects

- Opening and editing a Prefab

- Changing a prefab’s color

- Unity Asset Store where I can download assets and make them available in Unity

- Adding assets to modify existing prefabs

- Duplicating assets

Celebration:

- Successfully published a game to Unity Play

Unity Day 5

- Sadly, no progress

- I was distracted completing an Advent of Code challenge, then re-factoring that code to optimize its performance

- I accomplished what I wanted, but I broke my Unity learning streak

- I must remain committed to starting again tomorrow

Unity Day 6

- Downloaded Kart Microgame

- Completed 3 tutorials

- Change speed

- Change color

- Add ramp

- Attempted to complete Mod, but each required “ML_Agents” asset that my project didn’t include.

Unity Day 7

- Downloaded Platforming Microgame

- Completed 3 built-in tutorials

- Change player speed

- Change player color

- Add enemy

- Completed 2 mods

- Add billboard, and import, position & size a photo asset

- Edit the game menu text

Learned about:

- Using > icon to enter edit mode for a particular GameObject, especially ones not visible in the Scene

By now, have practiced a lot of:

- Selecting GameObjects in the Hierarchy pane

- Using the Pan, Zoom, Move, Rotate and Scale tools

- Editing properties of a GameObject using the Inspector sections

- Exploring a Project’s assets and adding them to the scene

- Completed first project in Foundations: Explore Unity mission

- Game engine, real-time — both were well defined

- Several industries using Unity

- An interactive demo showcasing how Unity is used in five industries

- Video of creators sharing how they discovered Unity

Unity Day 8

- New project from scratch

- Created two primitives

- One started as a child of the other

- Used Inspector to manually edit data: Scale Y property of a GameObject

- Used Scene controls

- QWERTY: Pan, Move, Rotate, Scale, Rect, Combo

- Right click + WASD QE

- ALT and CMD + Left click

- Created empty container primitive, Create empty

- Duplicated GameObjects

- Manually entered values into Transform fields

- Used tools in Scene to position a group of GameObjects

Unity Day 9

- Created several 3D elements and added them to the Scene

- Each one had a unique placement

- Each one had a RigidBody Component to give it realistic physics

- Modified the rotation of the Monument to further emphasize each hovering object’s behavior after falling

- Re-positioned the Main Camera so that it focused on the action occurring in the scene

- Created folders in my Project

- Imported an image asset by moving it directly into the Assets folder using Finder, not Unity

- Created a Material asset

- Mapped a Material asset to a GameObject’s Albedo property

- Created a Physic Material called BouncyBall

- Added a RigidBody Component to a Primitive 3D GameObject and mapped one of its properties to the BouncyBall Physic Material I created

- Rotated the Direct Light Source GameObject to adjust the virtual daylight in the Scene

Unity Day 10

- Searched for ‘materials’ in Unity Asset Store

- Filtered for Free materials

- Added a bundle to my assets

- Opened Unity, downloaded and imported the Material bundle I added in the asset store

- Created a 3D Plane GameObject

- Applied one of the many materials I downloaded: grass and leafs

- Updated the scene camera to display the new plane

- Playtested the scene

To-do:

- Complete this challenge

- Cause a ball to roll along a path, never touching the floor

- Completed the challenge

https://play.unity.com/mg/other/balldropbuild

- Practiced a lot of what I learned

- Creating primitive 3D GameObjects

- Importing particular assets: Materials

- Creating folders in Assets

- Creating new Physic Materials

- Applying Materials to GameObjects

- Adding components to GameObjects: RigidBody

- Setting properties of Components: Bounciness

- Moving, panning and zooming the scene

- Adjusting the camera

- Playtesting the game until the ball didn’t fall onto the lava

- Building the game files

- Uploading the game via Unity to Unity Play

- Recording a demo of the game

Unity Day 11

- Discovered the Console pane

- Used it to observe Debug logs running when one of two functions were called

- Added a new script component to several GameObjects

- Learned that the naming of things impacts how they are labeled in Unity and in scripts

- Edited the start() and update() functions in a new script

- Created public variables so they can be set in Unity’s Inspector

- used Unity API and it’s Vector3 and transform… objects to change a GameObject’s scale, position and rotation

- Wrote my first C# scripts

- Made Visual Studio Code the default IDE in Unity

Unity Day 12

- Learned about audio in Unity

- Added a free bundle of assets from Unity Assets Store

- Created a new project using a different template, Universal Pipeline

- Downloaded and imported the asset for use in the project

- Added an Audio Source component to a game object to generate background music

- Added an Audio Source component to a game object to generate 3D sound

- Adjusted properties in the Inspector to determine how soft or loud the 3D sound was based on the player’s position in the scene

Unity Day 13

- Added a Sphere GameObject to the scene

- Added a new script component

- Modified the script to include a public Vector3 property, and to update that property in the update() function

- Set the X position in the Inspector for that game object

- Added an audio component

- Imported a previously downloaded asset from Unity Asset Store

- Selected a few assets to import

- Mapped one of them to the Audio component on the GameObject

- Selected ‘Loop’

- Modified the Min and Max Distance

- Playtested the scene

- Built the project

- Couldn’t find a Publish menu option, so never published to Unity Play

Unity Day 14

- Completed all but the challenge in the 2D project

- Started with the 2D project template

- Added a 2D Sprite Circle GameObject

- Selected the Knob built-in asset image

- Changed its color using the Inspector

- Added a RigidBody 2D component to make it respect gravity (and fall)

- Added another 2D Sprite Square GameObject

- Gave it a RigidBody 2d component, too

- Added a Collider 2D component to each GameObject

- Froze the Square’s X, Y and Z positions so it wouldn’t fall

- Playtested the scene to ensure the knob fell onto the square

- Duplicated both objects and varied their size, rotation and position

- Playtested again to ensure the balls fell and rolled as expected

- Downloaded the free 2D Sprite bundle from the Unity Asset Store

- Imported the bundle into my project

- Am ready to recreate the Pachinko scene tomorrow

Unity Day 15

- Created several GameObjects from scratch

- Added necessary RigidBody and Circle/Box Collider Components

- Set Freeze properties for all but the GameObject that drops

- Struggled with adding the ground GameObject

- Messed up at first by setting Box Colliders instead of Circle Colliders

- Playtested and saw lackluster results

- Added a ton more falling objects…for more interesting results

- Updated the Z position so GameObjects would appear in front of or behind others

- Installed Web GL Build for latest Unity installation

- Still didn’t build or publish the project

- Learned a lot about the ways Unity is used through the lifecycle of a project

- Learned about specific roles that span industries

- Learned what skills are required to use Unity as a Generalist or Team-of-One

- Discovered I had to install the WebGL Publisher package to activate the Publish menu button

- Published my Audio and 2D projects

- Seems like I completed the Project: Unity Fundamentals

- Started Unit 1: Player Control

- Using starter assets, I’ll make a prototype for a driving simulator game

- Watched two videos: one introducing the unit, and another introducing the goal of the first lesson

- Made it as far as Lesson 1.1 — Start your 3D Engines

Unity Day 16

- Completed all four lessons in the Driver Simulator — Player Control unit

- Still need to complete the challenge and lab associated with the unit

Learned how to:

- Import .unitypackage files into Unity as Assets

- Associate a GameObject with the MainCamera

- Leverage a new game state function, LateUpdate, which smooths the camera. Whereas using Update makes the camera seem jittery as it follows a GameObject

- Create and incorporate variables into the expressions inside each game function

- Use built-in objects like Vector3 and its methods like up and right

- Use built-in Input object and its GetAxis method to hook into keyboard actions like the arrow keys

- Use multiplication to derive a non-zero value so the vehicle moved and rotated based on user input

- Use built-in GameObject object to make it such that the camera could associate itself with a GameObject

- Change the color of Unity’s UI when in Play mode

- Playtested a lot

Unity Day 17

- Completed the Unit challenge: Plane simulation

- Edited scripts to use variables, Vector3 methods, Time.deltaTime and speed

- Created a script to rotate the propeller

- Re-positioned the camera and made it follow the plane

- Made the up and down arrow keys adjust the plane’s appropriate angle of rotation

- Playtested a bunch to get everything right

- Completed the Quiz: 9/10

- Started the Bonus challenge: 4 increasingly difficult tasks for the Driver simulator

- Adding boxes seems easy and fun

- Adding vehicles seems doable by referencing the player car’s scripting code

- Camera switcher will require Googling to figure out how to hook into the right keyboard input, and whiting if…else clauses in C#

- Local multiplayer — involving two of everything (car, cameras, controls) seems daunting right now

Unity Day 18

- Completed 3 of the 4 bonus challenges

- Duplicated the boxes already in the scene into several varied arrangements

- Added four new vehicles facing the player car that move in the opposite direction, toward the player

- Added a second camera positioned on the hood of the player car and enabled the player to toggle their view by pressing C

- Did my first Googling for Unity

- using two cameras in a scene

- creating variables in C#

- Vector3 methods

- transform.position

- To make the camera work

- Duplicated MainCamera

- Renamed both camera GameObjects

- Followed instructions and copied code from a forum answer

- Two variables enabling mapping to two Camera GameObjects

- on Start, setting one to enabled and one to disabled

- on Update, toggling each one

- Also, depending on which one is enabled, updating the position of that camera to match that of the player GameObject, with some predefined offset.

Unity Day 19

- Completed 4th of 4 bonus challenges

- Added a second player vehicle with associated cameras and controls, and updated the game view to display side-by-side cameras

- Published my project on Unity Play:

https://play.unity.com/mg/other/webgl-builds-50835

- Used the project-supplied hints as a guide

- Found the duplicate Horizontal and Vertical Axes in Input Manager

- Changed their names to not conflict with similar Axes

- Assigned keyboard keys to all four directions

- Updated several attributes to match those of the similar Axes so player 2’s vehicle would move similarly

- Created a duplicate script for the new vehicle, changing the string for the GetAxis method call

- Duplicated existing camera GameObjects

- Moved vehicles to their new starting spots

- Renamed and reorganized the Hierarchy

- Used the Inspector to update both cameras’ Viewport Width Ratio from 1 to 0.5

- Updated Player 2’s camera’s X from 0 to 0.5

Unity Day 20

- Started the Roll-a-ball project

- Completed the first lesson: setting up the game

- Used the URP Unity Template

- Moved all existing assets into a new folder called Template

- Created a folder and a scene

- Added a plane to the scene and scaled it

- Added a sphere to the scene and positioned it

- Created two materials and added them to the plane and sphere

- Adjusted the directional lighting

Unity Day 21

- Continued the Roll-a-ball project

- Completed 4 lessons

- Installed and setup the Input System Unity package

- Created an Input folder in the main Assets folder, and an InputActions file

- Added a new script component to the Player GameObject and moved file to a new Scripts folder

- Opened the file in VS Code, ready to edit it

Unity Day 22

- Continued the Roll-a-ball project

- Completed tutorial section, Moving the Player

- Wrote C# code to enable the ball to move according to user input

- Used Vector2 and Vector3 data types

- Used private and public variables

- Created new functions, each one ‘void’ because they don’t return anything

- Used new C# syntax for the first time: < >

- Noticed I forgot to map the InputActions file to my Player GameObject. Until I did this, the ball did not respond to my input during play testing

Unity Day 23

- Continued the Roll-a-ball project

- Completed tutorial section, Setting up the Play Area

- Added a 3D Primitive Cube to the scene, called PickUp

- Adjusted its Transform properties in the Inspector

- Duplicated it three times, adjusting each one’s Transform properties

- Eventually had four walls for the Player GameObject to collide with

- Each Cube came pre-configured with a Collider mesh

- Completed tutorial section, Creating Collectibles

- Created a Prefab from a 3D Primitive Cube, by dragging it into a newly created folder called Prefabs

- Rotated the Cube using the Transform controls in the Inspector

- Created a script to rotate the cube each frame

- Used transform.Rotate, new Vector3, and Time.deltaTime

- Updated the GameObject’s appearance by creating a custom Material

- Added a Parent GameObject to the scene, moving PickUp as its child — Duplicated 11 PickUp prefabs and placed them around the scene

- Not sure how the tutorial got a reset set of XYZ controls. Mine were angled according to PickUp’s rotation

Unity Day 24

- Completed the Roll-a-ball project

- Completed tutorial section, Detecting collisions with collectibles

- Learned difference in toggling ‘Use Gravity’ and ‘Is Kinetic’

- Learned what toggling ‘Is trigger’ on RigidBody component does

- Used new namespaces in C# script: TMPro (TextMeshPro), UnityEngine.InputSystem

- Created additional variables to store count int and references to GameObjects

- Used built-in SetActive method and boolean values

- Used Tagging system in Unity, including creating new tags

- Completed tutorial section, Displaying score and text

- Created UI > Text — TextMeshPro GameObject

- Learned about Canvas and it’s local coordinate Rect Transform system

- Repositioned text inside Canvas

- Styled and aligned text

- Created new functions, including one built-in to work when an event is triggered

- Called functions from within other functions

- Wrote conditional logic

- Completed tutorial section, Build the game

- Built a native macOS version

- Built and published a WebGL version to Unity Play

https://play.unity.com/mg/other/webgl-builds-52886

Unity Day 25

- Resumed course, Create with Code

- Previously completed Project, Unit 1 — Player Control

- Now onto Project, Unit 2 — Basic Gameplay

- Completed Introduction tutorial

- Completed Lesson 2.1 — Player Position

- Imported downloaded .unitypackage file

- Added several assets to the scene: human, animals, food

- Positioned and scaled several gameObjects

- Created a Scripts folder and C# Script

- Added the script as component of Player by dragging the script file onto the Player GameObject in the Hierarchy pane

- Updated the script

- Added several public variables

- Modified the Update() function

- Captured the horizontal movement value

- Updated the player game object to move according to horizontal movement, a pre-determined speed, and an amount of time that has passed via Time.deltaTime

- Checked for the player being beyond a predetermined x range of boundary by way of two If-statements

- Playtested along the way to confirm the player can move left and right only as far as 10 points

Unity Day 26

- Completed Lesson 2.2 — Food Fight

- Added automatic movement ‘up’ to the food projectile

- Added automatic movement ‘down’ to each of the animals

- Converted food and animals to Prefabs

- Checked for when food and animals moved ‘off screen’ and destroyed them to remove them from the scene

- Used new Input method, GetKeyDown, and new built-in object, KeyCode.Space

- Used new functions, Instantiate and Destroy

- Instantiate accepts at least three arguments: object, position, rotation

- Destroy accepts at least one argument: object

- Learned that I can drag elements from Project pane onto Scene to make them temporarily part of the Game

- Learned I can bulk add a component to multiple GameObjects by selecting in Project pane and clicking Add Component

Unity Day 27

- Completed Lesson 2.3 — Random Animal Stampede

- Created an Empty Object to act as a ‘Spawn Manager’

- Created a script of the same name and associated it with the empty object

- Used Array-like syntax to set the type of an expected set of objects, GameObject[]

- Used the inspector to set the size of the array

- Dragged Prefabs onto each slot of the array to associate an animal with the object

- Added a condition, checking for the press of the S key

- When pressed, the same animal GameObject would spawn in the top-center of the game area and march toward the player until eventually disappearing and being deleted

- Used Random.Range() and Length to dynamically generate a different animal each time

- Created variables that specified positions for use in the condition

- Enhanced the code to specify ranges along the X axis so animals would spawn at different horizontal locations, too

- Learned about the different camera options: orthogonal and perspective

Unity Day 28

- Completed Lesson 2.4 — Collision Decisions

- Refactored code to include new function that spawned animals

- Used built-in InvokeRepeating method to start a recurring timer to spawn animals

- Created variables to control the delay and interval of spawn

- Learned how to edit a GameObject’s Box Collider box

- Learned how to access both objects from a Collider event

- Playtested a lot, noticing the animals weren’t being removed with food upon collision

- Noticed that I forgot to add Box Collider to the food projectile

- Playtested more, noticed the Fox wasn’t being destroyed upon collision

- Still not sure what’s up with the fox

- Replaced fox with Moose prefab

- Playtested to confirm game works as expected

- Adjusted speed of each animal to make game feel easier

- Published the game on Unity Play

https://play.unity.com/mg/other/webgl-builds-54229

- Downloaded starter files for Challenge 2

- Watched video introduction and overview of Challenge 2 tasks and outcome

Unity Day 29

- Completed Challenge 2 — Play Fetch

- Fixed several bugs in the program, and added functionality

- Replaced dogs with balls

- Replaced dogs with balls

- Updated values and comparison operators so game objects destroyed appropriately

- Refactored a static interval with a range of possible values

- Used Time.realtimeSinceStartup to compare two timestamps so the player could only spawn a dog at set intervals

- Added code to allow any of the three balls to be used, instead of just the first one

- Playtested along the way to confirm I fixed the bug

Unity Day 30

- Attempted a challenge of my own

- Add UI text to the game displaying balls caught out of total balls dropped

- Successes:

- Added UI > Text Mesh Pro to the hierarchy

- Duplicated the single text GameObject a few times

- Positioned, renamed and realigned all new text GameObjects

- Updated the SpawnManagerX script

- using TMPro

- new TextMeshProUGUI variable

- Initialized a count, incremented it and updated text on one of the GameObjects

- Used Inspector to connect the Text GameObject to the SpawnManager

- Failure and subsequent learning:

- Updated DetectCollisions script

- Added TextMeshPro references

- Initialized and incremented a count

- Tried using Inspector to connect the other Text GameObject to each Ball Prefab

- Unity prevented this action

- After some research, it seems Prefabs maybe can’t have TextMeshPro GameObjects mapped to them, in addition to other limits?

- Deleted all uses and references to the UI

- Published the finished challenge where a triggered dog runs to catch dropping balls

https://play.unity.com/mg/other/webgl-builds-54229

- Got 7/10 right in the quiz

- Glanced at the 4 bonus challenges for this lesson

- The third one sounds exactly like the problem I couldn’t address this time: updating text based on collisions

Unity Day 31

- Completed Bonus challenge 1 of 4: Vertical movement

- Duplicated some of the existing code

- Changed Vector3.right to Vector3.forward — after trying Vector3.up

- Determined which axis to target: Z

- Playtested to confirm it worked as expected

- Attempted Bonus challenge 2 of 4: Aggressive animals

- Targeted the SpawnManager.cs file

- Recognized that I would have to spawn three animals instead of one

- Duplicated two code expressions, spawnPos and Instantiate

- Tried updating transform.rotation by performing simple arithmetic: — 90

- Error in Unity mentioned a Quaternion value

- After some Unity documentation research, I was genuinely confused

- Tried a few other methods for achieving the correct rotation

- Nothing seemed to do the trick

- Cheated and viewed the step-by-step instructions

- Turns out this ‘Medium’ challenge requires a LOT of work, most of which I would not have thought to try

- Tomorrow I’ll go step by step to complete this challenge

Unity Day 32

- Completed Bonus challenge 2 of 4: Aggressive animals

- Used step-by-step PDF guide because I was unable to plan and execute the work unaided

- I was on the right track in duplicating the code that set a position and instantiated a game object

- I learned how to use Quaternion.Euler() to update a Prefab’s rotation dynamically

- Added more variables to a few other functions to account for additional position boundaries

- Added variable to leverage a new empty game object that would act as the spawn location for the food projectile

- This was needed since the player object is now part of collision detection with the animals

- I accounted for gaps in the step-by-step guide: remembering to add function calls for each of the new SpawnAnimal functions, and turning off ‘Use Gravity’ on the Player object’s new RigidBody component

- Overall, the new concept was Quaternion and its corresponding method, Euler

- The rest was great practice in creating and setting variables, adding and customizing components

Unity Day 33

- Completed Bonus challenge 3 of 4: Game User Interface

- Used step-by-step PDF guide from the start since I struggled previously making UI text dynamically update, and because I noticed that this challenge used the Console, not on-screen text elements

- Created a new C# script

- Setup a few integers

- Added two public functions, AddLives and AddScore

- Each function expected one integer as input

- Each function used the input to update the lives and score variables, and account for when lives was 0

- Learned how to directly access public methods in other scripts:

- GameObject.Find(‘NAME OF GAME OBJECT’).GetComponent<NAME OF SCRIPT>()

- Saving that to a GameManager type variable enables access to that script’s public methods

- Used both methods in other scripts to increment and decrement and log messages to the console when animals went out of bounds, collided with the player, or collided with the projectile

- Created the empty GameManager game object and assigned the Script as a component

- Added ‘Animal’ as a tag and assigned it to each animal prefab

- Playtested to confirm the logging of each unique message with the appropriate values

- Several tutorial series queued up:

- Beginner Scripting:

https://learn.unity.com/project/beginner-gameplay-scripting

- Junior Programmer:

https://learn.unity.com/pathway/junior-programmer

- John Lemon’s Haunted Jaunt:

https://learn.unity.com/project/john-lemon-s-haunted-jaunt-3d-beginner

- Creator kits:

https://learn.unity.com/projects?k=%5B%22lang%3Aen%22%2C%22q%3Acreator+kits%22%5D&ob=recency

- Unit 3 — Sound and Effects

https://learn.unity.com/project/unit-3-sound-and-effects

Unity Day 34

- Completed Bonus challenge 4 of 4 — Animal Hunger Bar

- used step-by-step guide since I had no idea how to even begin

- Used a new primitive UI game object called Slider

- Comes with Canvas, Slider > Fill Area > Background and Fill

- Customized several aspects of each inner component

- Created a script that would eventually attach to each animal

- used UnityEngine.UI

- setup some initial variables to store how much animal had eaten and when they were ‘full’ and should disappear from the game

- used SetActive to toggle visibility of game objects

- used gameManager, GetComponent, <> syntax to refer to components attached to gameobjects

- write some custom functions that would later be called from other scripts

- used Inspector to associate the Slider with the Animal instance

- used Overrides dropdown to update each Prefab with the new settings on the animal in the scene

- repeated for each animal prefab

- Playtested only to realize that the hunger bars were gigantic

- Through trial and error, I successfully scaled everything down

- Two of the three animals were fixed, but the chicken’s hunger bar was still very small

- Playtesting at least showed that the new hunger bars functioned as expected

Unity Days 35, 36, 37, 38

- Published completed Unit 2 — Basic Gameplay project

https://play.unity.com/mg/other/webgl-builds-54229

Being over 1/3 into 100 day challenge, I should attempt to recall 100 things I’ve learned thus far

Today, 35 things. Tomorrow, 36 things. Day after, 50 things, totaling 121. Day after that, 10 things, totaling 131.

  1. Unity is a game engine
  2. A game engine is software used to create, compose, program and build a game by combining its individual parts
  3. Each of these parts are created in Digital Content Creation (DCC) tools: artwork, 3D models, sound, and lots more
  4. Unity and Unreal Engine are two of the same kind, and the first of their kind: free to use game engines that empower game creators to more rapidly start making games
  5. Unity is now a suite of products and channels: Unity Hub, Unity, Unity Play, Unity Learn, Unity Store
  6. Unity Hub is where you manage several things: personal projects, installations of Unity, new educational resources on Unity learn, and projects from other Unity creators
  7. New minor versions of Unity are released frequently — sometimes once per week
  8. Different versions of Unity can be installed via Unity Hub
  9. When creating a project, you can select the version of Unity to use
  10. Each version of Unity comes with the option to install any of 10+ modules, each enabling you to build a package of your game for publishing on a wide range of operating systems and platforms
  11. The Module beginners use — especially throughout tutorials — is the WebGL module. It enables building a package of your game for publishing on the World Wide Web as a web page
  12. When creating a new project, you can select from a few — and download other — templates that fit your game type: 2D, 3D, VR, and one called Universal Render Pipeline (URP)
  13. The templates that are downloadable include ‘Microgames’: these are pre-built games with curated tutorials designed to help beginners start getting comfortable using Unity
  14. The Microgame with the most extendability and community behind it is the LEGO one
  15. Creating a new project — or selecting an existing one from the Projects pane in Unity Hub — launches Unity, the game engine
  16. Unity is comprised of four main areas: Hierarchy, current scene (or the game scene), Project assets, and the Inspector
  17. Scene is the playground, the canvas, where one area in a game is built from the composition of several assets and behaviors
  18. Hierarchy is the tree-structured list of assets contained in the selected scene
  19. Project is the tree-structured list of assets available for use in the game
  20. Inspector is the form-based list of editable properties associated with the selected game object and its one or many components
  21. Between the title bar and the first set of panes is a toolbar containing important controls
  22. Popular controls include: navigating the scene, and directly manipulating a game object’s position, rotation or scale
  23. There are also controls to play test the game
  24. On the far right side of the toolbar are a few selection menus — one of which is a way to customize the layout of Unity’s various panes
  25. The navigation and manipulation controls have handy keyboard and mouse shortcuts mapped to QWERTY and WASD
  26. When a project is created from scratch, two important Game Objects already exist in the only scene’s Hierarchy: a camera and a light source
  27. More Game Objects can be added to the hierarchy — by way of clicking a + button, or by right-clicking in the empty space within the hierarchy pane
  28. Objects include Primitives — 3D objects like cubes, spheres and planes
  29. Objects include Sounds, Effects, Light and Video
  30. Objects include User Interface elements, like text
  31. Object include empty containers — these can act as grouping mechanisms for other objects, or as vessels for behavior otherwise associated with a visible game object
  32. Every Game Object has editable properties. Most of these properties are only editable from the Inspector, when that Game Object is selected
  33. Every Game Object is composed of one or more components
  34. Every Game Object has a name, and can be assigned a tag, and can be assigned to a layer other than Default
  35. Most Game Objects have a Transform component which sets that object’s Position, Rotation and Scale in three dimensions: X, Y and Z
  36. Other seemingly popular components include: Colliders, RigidBody, Scripts
  37. Collider components enable an object to respond visually and behaviorally when other Game Objects’ paths intersect with theirs
  38. A collision may result in an object merely moving based on virtual physics and gravity
  39. Or a collision may result in an event being triggered so that some game state can be updated, including one or both colliding objects’ existence
  40. RigidBody components give Game Objects mass and weight — so it behaves naturally when acting in the game world
  41. Script components enable the programmatic customization of a Game Object’s state based on elements and events involving that object
  42. Scripts are written in C# programming language
  43. When a new Script component is generated in Unity, it includes some important lines of code
  44. Each script imports three dependency modules: Sytem.Collections, System.Collections.Generic, and UnityEngine
  45. Each script defines a public class that inherits from the MonoBehaviour object or data type
  46. Each public class includes two private empty functions, Start and Update
  47. Start is run when once, when the game starts
  48. Update is run once per frame
  49. Other lifecycle functions built-in to Unity include: LateUpdate, OnTriggerEnter, OnMove, FixedUpdate
  50. OnTriggerEnter is often used in conjunction with Game Objects that have Collider components. The code written inside this function has access to both colliding objects.
  51. The code I wrote commonly used the built-in Destroy function to remove one or both of the colliding Game Objects from the scene
  52. LateUpdate was used when resetting the location of the scene’s camera(s)
  53. Unlike Update, LateUpdate is called after all Update methods for each frame, and therefore creates a smoother transition between frames
  54. FixedUpdate is preferred to Update when manipulating objects with physics applied — often via RigidBody components — because it is called 0 or more times per frame by the physics engine
  55. OnMove came as part of the module UnityEngine.InputSystem and made a Game Object’s position properties readable and writable via an accessible movement API
  56. TMPro is another module for use in scripts. It stands for TextMeshPro. It is an API for interacting with UI-related Game Objects like text overlays.
  57. The Package Manager is a critical aspect of Unity, enabling the importing of assets and functionality — that either you created or that others created — into your project
  58. Unity Store is an online marketplace full of asset bundles that range from free to pricey
  59. As long as you log in with your Unity ID to Unity Store, then anything you buy can be downloaded and made ready to import from Unity’s Package Manager
  60. Packages could be bundles of assets, or entire suites of code enabling the publishing of a game to a specific platform, like WebGL
  61. In fact, the package I added most often was the WebGL Publisher package. It added a Publish menu item to unity that enabled near-single-click publishing of my game to Unity Play, the official gallery of community-made Unity games
  62. Using a package’s contents requires a few steps: download, import (all or some of what you need), and add to the scene — and hierarchy by way of being dragged into a scene
  63. After download and import, a package’s contents become Assets available for selection, modification and use in any of your project’s scenes
  64. A project’s Assets folder often contains a few important folders: Scenes, Scripts, Materials, Prefabs
  65. Scenes represent a grouping of assets that account for one area in a game
  66. Scripts are the programmed behavior enabling a player to successfully interact with the assets in a scene
  67. Materials are elements that enhance an asset’s appearance or perceivable qualities: textures, colors, etc.
  68. Prefabs — short for Prefabricated assets — are clone-able templates. When cloned, they create Game Objects that share important characteristics.
  69. Prefabs are like Symbols and Masters in other design tools: any GameObject made from a Prefab inherits certain characteristics. Updating the Prefab immediately updates each instance of Game Object made from that Prefab.
  70. To make a Prefab: a Game Object is added to the hierarchy, configured via the Inspector, then converted to a Prefab
  71. Conveniently, a Prefab can be created just by dragging a Game Object into a the Prefabs Asset folder
  72. Game Objects can have a parent-child relationship, as seen in the Hierarchy
  73. As expected, all of a Game Object’s child Game Objects transform appropriately when the parent object is transformed
  74. It is common for the parent-most Game Object to be an Empty Object, serving merely as an invisible grouping mechanism for its child Game Object assets
  75. Collider components have a property ‘Is Trigger’ that, when checked, enables the collider’s ability to respond to events and deactivates its normal behavior of moving when another object comes in contact
  76. Rigidbody components have a property ‘Use Gravity’ that, when unchecked, prevent the virtual gravity in the game from causing the object to fall
  77. Rigidbody components also have a property ‘Freeze’ and a checkbox for each of the three X, Y, Z axes that, when checked, lock the game object in a particular position in the scene but still act as physical objects that prevent other Rigidbody game objects from falling through them
  78. When you declare a public variable inside the default MonoBehaviour-extended class, it becomes an additional form field in that game object’s Script component in the Inspector
  79. With this added form field, you can enter or edit an expected value, or associate an expected game object with the script
  80. Some helpful Unity-specific objects and data types made available in each script include: Time.deltaTime, Vector3, GameObject, GetComponent, transform[.Translate,.Rotate,position], Quaternion.Euler, Instantiate, Destroy, SetActive, AddForce, CompareTag, Input.GetAxis, Debug.Log, InvokeRepeating
  81. Audio is a component in Unity, and can be 2D and 3D
  82. GameObjects with an Audio component set to 2D is either playing or muted
  83. GameObjects with an Audio component set to 3D can be heard when within range, and is softer or louder based on the player’s proximity
  84. A major difference between 2D and 3D games is merely the position of the camera.
  85. In 3D games, the camera is not fixed and therefore shows all three axes
  86. In 2D games, the camera is fixed in one of the three axis, so it only moves in the other two perpendicular axes, like X and Y — fixed on the Z axis
  87. In 2D games, it is possible and common to adjust the camera so it is orthogonal, not in perspective. Doing this makes 3D objects appear flatter, as expected by the player.
  88. A scene can contain multiple cameras. This is mandatory for cooperative games. Each camera’s size can be changed from full-width of the scene to 1/2 as wide as the scene — and positioned and mapped to each player accordingly.
  89. Movement along the ‘vertical’ axis connotes moving forward and backward using either the ‘W’ and ’S’ keys or the up and down arrow keys
  90. Movement along the ‘horizontal’ axis connotes moving left and right using either the ‘A’ and ‘D’ keys or the left and right arrow keys
  91. In a script, the movement in either axis is read and written using Input.GetAxis() and passing the appropriate axis string
  92. Time.deltaTime is used to transform an object at a constant speed since it evaluates to the time between the last frame and the current frame
  93. It is common to perform a natural-feeling transformation on a GameObject by calculating the product of any directional or rotation or transformation with Time.deltaTime with a customizable ‘speed’ variable
  94. In order to perform a rotation programmatically, you must use a Quaternion value. Specifically, calling Quaternion.Euler() with a Vector3-type transformation, like (0,90,0) in order to rotate an object by 90 degrees
  95. The three parameters of Vector3 are for X, Y and Z axes
  96. Each GameObject can be transformed by using the transform API, like transform.position or transform.Rotate() or transform.Translate()
  97. GetComponent method uses the < > syntax to refer to a specific component on a Game Object by name, like this: GetComponent<ComponentName>()
  98. SetActive method expects a boolean value as input: if true, the GameObject it renders in the scene. If false, it does not render.
  99. GameObjects can have one tag assigned, as a way of classifying them. In a script, you can check a Game Object’s tag using CompareTag() passing in the string of the assigned tag. This is helpful in OnTriggerEvent to check whether the collision occurred between objects of the correct classification.
  100. Debug.Log() prints a message to Unity’s console
  101. Vector3 has convenient built-in methods, like .forward .right and .up, each accounting for a positive or negative 1 in one of the three axis values, and a 0 in both of the others
  102. If you want a variable to be editable from the Inspector, make it public, not private
  103. Functions prefixed with void do not explicitly return a value
  104. You can store a reference to what seems like any of the current scene’s GameObject’s components using the expression, GameObject.Find(“GameObject’sGivenName”).GetComponent<ComponentName>()
  105. A way to generate a random number is by using Random.Range() passing a minimum and maximum value
  106. To determine which key a player is pressing, use Input.GetKeyDown() passing the appropriate property of KeyCode
  107. Camera GameObjects have a property, enabled, that controls whether they are ‘on’ or ‘off’
  108. Unity has a robust Project Settings set of menu screens found under Edit > Project Settings…
  109. One important screen is the Input Manager, where player controls are mapped to various input types
  110. It is in the Input Manager that names are established for use in scripts via ‘GetAxis()’, and that other elements are configured that you might use via UnityEngine.Input API in your scripts
  111. If you’ve generated or downloaded a .unitypackage file, the way to import it into your Project is via the Assets menu, Import Package sub-menu, then Custom package…
  112. There are several types of Colliders: Box Collider, Box Collider 2D, Sphere Collider, Mesh Collider
  113. There are two types of Rigidbodys: RigidBody and RigidBody 2D
  114. It’s important to use the right Collider and Rigidbody based on the game type (2D or 3D) and on the object’s inferred shape (box, sphere or mesh)
  115. Adjusting the rotation of the natural game light source is the equivalent of setting the location of the sun: it will range from day and night
  116. The layout of Unity’s panes and toolbars is fully customizable
  117. The interface is also customizable. For instance, you can change Unity’s UI color when in play test mode. This is a helpful visual cue to know which mode you’re in
  118. A 3D game’s scene can be toggled to show it in 2D via a simple button click in the Scene pane’s toolbar
  119. The camera in the scene can be toggled between normal ‘perspective’ mode and an isometric view
  120. Each component has three small icons to the far right of its collapsible header. The right-most one is a series of three vertical eplipses
  121. In the case of the Transform component, the first menu item in the contextual menu beyond the three ellipses is ‘Reset’, quickly returning any funky values for Position, Rotation or Scale back to 0s, 0s and 1s respectively
  122. Q is a shortcut for the Hand tool, used to move around along one axis in the scene
  123. W is a shortcut for the Move tool. When a Game Object is selected, it displays a tri-axis widget to manipulate the Position transform properties of the object
  124. E is a shortcut for the Rotate tool. When a Game Object is selected, it displays a tri-axis widget to manipulate the Rotation transform properties of the object
  125. R is a shortcut for the Scale tool. When a Game Object is selected, it displays a tri-axis widget to manipulate the Scale transform properties of the object
  126. T is a shortcut for the Rect tool. When a Game Object is selected, it displays a rectangle widget to manipulate scale of the object in two of the three axis depending on the position of the scene’s camera
  127. Y is a shortcut for an all-in-one Transform tool. When a Game Object is selected it displays each of the above tri-axis widgets to manipulate all three transform properties of the object
  128. When the right-click mouse button is pressed: W moves the camera forward, S moves it backward, A moves it left, D moves it right, Q moves it down, E moves it up, and holding Shift and any key moves it faster
  129. When Alt or Option is pressed, clicking the left mouse button and dragging rotates the camera along an invisible center point within the scene
  130. When Alt or Option and Command are pressed, clicking the left mouse button and dragging performs the same action as the Hand Tool…panning the camera in two axis within the scene
  131. The bounding box of a Collider component can be edited using the ‘Edit Collider’ button. This reveals a green outlined shape that can be transformed to better fit the Game Object’s form

- Note to self: 131 is enough. Time to start practicing and learning more by continuing Unity Learn.

Unity Day 39

- Started Unit 3 project in Create with Code course: Sound and Effects

- Outcome is an endless runner game where the player must jump to avoid never-ending obstacles

- Lesson 3.1 consisted of

- Creating a new project

- Importing the provided start file .unitypackage filled with important assets

- Adding and positioning a player GameObject

- Adding and positioning an obstacle GameObject

- Creating an Empty Object that will be used to constantly generate other GameObjects

- Creating folders for Scripts and Prefabs

- Creating three scripts in total: for the player, for the obstacle and background, and for the proverbial Spawn Manager

- Play testing after each batch of script additions and Inspector value updates

- Practiced more of

- Adding components like Box Collider and Rigidbody and Scripts

- Editing a collider’s bounding box

- Navigating a scene

- Adding variables to a script

- Editing Start and Update functions

- Adding new functions and using them inside Start and Update

- Conditional code based on a specific key press

- Using GetComponent to store a reference to a specific component attached to a GameObject

- Using AddForce to move an object in a direction through manipulation of its Rigidbody component

- transform.Translate() and Time.deltaTime

- InvokeRepeating and Instantiate with a start delay and interval timer

- Adding a GameObject to the scene, Converting the GameObject into a Prefab, later updating the GameObject, Overriding its Prefab, deleting that GameObject from the scene, and reattaching the Prefab to another GameObject’s Script component

- Learned about

- OnCollisionEnter event function, used to detect when one object collides with another

- Built-in Physics object and one of its settable properties, gravity

Unity Day 40

- Completed Lesson 3.2 of Unit 3: Make the World Whiz By

- Tasks included

- Simulated a repeating background by re-positioning that GameObject under a specific condition

- Added a ‘game over’ trigger: when the player collides with an obstacle

- Stopped objects from continuing to move when the ‘game over’ criteria is met

- Destroyed objects that reached off-screen

- Prevented additional objects from generating once the ‘game over’ criteria is met

- Practiced more of

- Creating scripts and attaching them to game objects as components

- Creating public and private variables

- Using GetComponent<>() and GameObject.Find() to make components available from any script

- Using gameObject.CompareTag() to restrict which objects respond to collisions and in what ways

- Using Debug.Log() to display messages in Unity’s console

- Using Destroy() to remove game objects from the scene

Learned about

- New data type, PlayerController — used for storing reference to a script component

Unity Day 41

- Completed Lesson 3.3 of Unit 3: Don’t Just Stand There

- Tasks included

- Updating the player’s animation based on the game state, player interaction and collisions

- Updating the PlayerController script to trigger animation changes and prevent player interaction when certain game state is active

- Learned about

- Animator pane in Unity

- Animator is a type of component

- It expects a Controller asset as an input, called an Animator Controller

- That Controller is what opens in the Animator pane

- An Animator has one or more layers

- Each layer contains one or more states

- Each state has properties that can be edited via the Inspector

- Each state connects to one or more other states by way of Transitions

- A Transition is triggered based on a multi-expression condition

- The conditions correspond to the Animator Controller’s parameters

- States can be set as default, updating the player’s animation when the game starts

- Updating Animator Controller parameter values and triggering different transitions from one state to another for a particular layer

- Used GetComponent<>() to reference the Animator component of the Player gameObject

- Used SetTrigger() and “Jump_trig” to programmatically transition the player into the jumping state

- Used SetBool() to modify one of the parameters, transitioning the player into the death state

- Used SetInteger() to modify one of the parameters, selecting which death state to use

- Practiced

- Used the ! Operator to conditionally prevent the player from jumping when the gameOver variable is true: by way of !gameOver

Unity Day 42

- Brief sampling of ProBuilder via 4-step tutorial

- Used the Roll-a-ball project as guinea pig

- Opened Package Manager

- Found ProBuilder in the Registry list

- Downloaded it

- Opened the pane via Window > ProBuilder > Editor

- Docked the pane along with Inspector

- Used the + button next to New Shape to create a shape in the scene and start editing it

- Changed each of the available properties: shape type, side, height, etc.

- Pressed ‘Build’ to commit the creation of the shape

- Selected one of the center ‘faces’

- Switched selection mode to ‘Select Face Loop’, seemingly selecting all faces horizontally on the cylinder

- Used the + button next to Extrude… to further mutate the shape

- Kept the ‘Face Normal’ selection

- Doubled the distance to 1

- Pressed ‘Build’ to commit the action

- Used Command modifier to add to the current selection additional faces

- Used the Move gizmo to extrude more faces in one direction

- I’m excited to find more tutorials that might help teach me 3D modeling fundamentals

- Right now, ProBuilder feels powerful but foreign, just like 3DS Max and Maya did to me years ago

Unity Day 43

- Completed Lesson 3.4 of Unit 3 — Particles and Sound Effects

- Tasks included

- Add particle effect assets to the hierarchy

- Adjust their properties according to personal taste

- Move them in the hierarchy to become children of the Player object

- Map them to the Player object’s script component

- Play and Stop them based on conditions already in the script

- Add Audio component to the Main Camera

- Adjust the volume

- Map an audio file to the audio component

- Add Audio component to the Player

- Use scripting to dynamically associate audio clips to it depending on existing conditions

- Learned about

- Play(), Stop() and PlayOneShot() methods of Audio Source components

- Using particle effects: previewing, configuring, controlling playback programmatically

- Use scripting to dynamically associate audio clips to it depending on existing conditions

- Practiced

- Creating variables in a script using private and public and the proper data types

- Using GetComponent<>() syntax to store references to a Game Object’s component

- Adding Audio Source components

- Mapping assets to a Game Object’s component after declaring a variable in its associated script

- Adjusting the properties of a component in the Inspector or other built-in Unity widget

Unity Day 44

- Using my MacBook Air while on vacation

- Downloaded Unity Hub, signed in with my ID, installed latest version of Unity

- Created a new Project using 3D template

- Installed ProBuilder via the Package Manager

- Explored the shapes available in ProBuilder

- Cube: Adjustable in all three axes

- Sprite: seems like a plane, only one axis

- Prism: similar to cube, but one less side: adjustable in all three axis

- Stair: Adjustable steps, width, height, and curvature with corresponding radius

- Cylinder: Adjustable radius, sides, height and smoothness

- Door: Adjustable width, height, depth and inner height and width

- Plane: Adjustable width, length and axis

- Pipe: think Mario: Adjustable radius, height, thickness, sides

- Cone: Adjustable radius, height, sides

- Arch: Adjustable radius, thickness, depth, sides, length from starting point out of 360 degree

- Sphere: Adjustable radius and subdivisions — 1 to 5, 5 being a near-perfectly smooth sphere

- Torus: think ring: Adjustable Rows (more rows, more curvature), Columns (more columns, more curvature), radius, circumferences (from starting point out of 360 to form ring, from starting point out of 360 to form enclosed ring)

- Learned keyboard shortcut Shift + Cmd + K to reopen Shape Tool

- Things with a radius

- Cylinder, Pipe, Cone, Arch, Torus, Stair, Sphere

- Single-axis things

- Sprite, Plane

- Three-axis things

- Cube, Prism, Door

Unity Day 45

- Played a bit more with ProBuilder

- Rediscovered how to select individual faces of an object

- Learned what selecting face loop vs. face ring means

- Extruded a bunch of faces

- Created a new Poly Shape by drawing points in the scene and connecting to make a shape, then clicking again to add depth to that shape

- Extruded one of that shape’s faces, moved, rotated it and other faces to create an odd looking shape

- Tons more to discover here, but using the trackpad on my MacBook is not an effective way to use Unity

Unity Day 46

- Started reviewing these notes

- Made it to Day 15-ish, then lost interest

- Played around with ProBuilder some more

- New shapes: Prism, Cube, Cylinder

- Face selection

- Extrude Faces

- Subdivide Faces

- Merge Faces

- Make a Lego block from a Cube and two Cylinders

- Made an odd-looking model from several extrusions and rotated faces

- Unable to Subdivide Faces in such a way to make extruding a cylinder from an object’s face possible: to recreate the bottom of a Lego block

Unity Day 47

- Back home on my Mac mini, keyboard and mouse — much more comfortable

- Completed Challenge 3 in Unit 3 — Sound and Effects: Balloons, Bombs & Booleans

- Like Challenges 1 and 2 before, this series of exercises involved debugging and adding code to scripts

- One script was missing a reference to the Player object’s Rigidbody component, so it couldn’t be controlled by the player

- One script needed a ‘!’ To reverse the check for whether the background should move

- One child object, an FX object, needed to be repositioning so it was intersecting with the Player object…not far to its right

- One script needed one character change, a ‘y’ to an ‘x’, so that the background moved and repeated at the appropriate interval

- One script needed a few new lines and expressions in order to prevent the balloon from flying too high and from falling too low

- One Game Object, ‘Ground’, needed to be tagged as ‘Ground’ in order for the code in the script referenced in the previous bullet to work appropriately

- I needed to use several of the provided hints in order to complete this challenge

- Perhaps if I allowed myself more time to deeply study the broken code and cross-reference with what I saw in the Inspector, I would have solved more exercises without help

- Still, I understood each hint enough to fix the code and perform the necessary actions in Unity

- And I understood why each fix was important

Unity Day 48

- Completed Unit 3 quiz

- 9/10 correct

- Incorrect question I failed to pay attention to the detail in the direction of the line: from Run to Walk, not Walk to Run

Unity Day 49

- No further learning, building or scripting today

- Played a few games submitted to Made with Unity Showcase — June

- Each one seemed like an incredible extension of one of the projects from the ‘Create with Code’ path that I’m undergoing

Unity Day 50

- Completed the Easy and Medium challenges associated with Unit 3

- Easy: update SpawnManager to generate a variety of obstacle gameObjects, instead of the same one

- Medium: enable the player to jump once, or jump twice

- Practiced by way of reference:

- Using array type syntax, GameObject[]

- Storing reference to an index within a list using Random.Range and length

- Referencing that index to pull the right gameObject and its transform.rotation value

- Adding a gameObject to the scene, adding the appropriate components, editing the box collider, and dragging the customized gameObject from Hierarchy to Prefabs Project folder to create an Original Prefab, deleting the object from the scene

- Remembering to Tag each prefab with ‘Obstacle’ so that the code targeting it would successfully Destroy those objects after they moved off-screen

- Selecting Prefabs to associate with my new SpawnManager list

- Refactoring existing conditional logic to account for a new boolean value, canJumpAgain

- Extracting repeated code into a new function, jump()

Unity Day 51

- Completed one part of Hard challenge from Unit 3

- Enable dash ability: when a key is pressed and held, simulate the player moving at a faster speed than normal

- Two parts:

- Make the world appear to move faster

- Make the player appear to run faster

- Part one seemed simple enough:

- New variable in PlayerController, boolean, representing whether player was in faster running state or not

- New condition in MoveLeft script to check state of player boolean: if false, return to normal speed…if true, increase to 1.5x regular speed

- Playtested, worked as expected

- Part two was frustrating

- I didn’t know how to programmatically update a property of a layer state, namely ‘Run_Static’s ‘speed’ property

- I did notice that the ‘speed’ property featured the ability to toggle on a ‘Multiplier’ checkbox, and set that to one of the parameters, which I know how to set programmatically

- I toggled it on, selected ‘Speed_f’ from the dropdown

- I updated PlayerController with two statements that set playerAnim.SetFloat(“Speed_f”, [number])

- I continued to get an error stating ‘Parameter type does not match’

- Unable to troubleshoot, I resorted to looking at the step-by-step solution walkthrough

- It had me create a new parameter, ‘Speed_Multiplier’, and do the exact same thing

- I did, but got a different error ‘Cannot convert double to float’

- Alas, I neglected to type ‘f’ after each number in my script: 2.0 instead of 2.0f

- Everything worked when I added the required f for ‘float’

- Hopefully I won’t make that mistake much longer

Unity Day 52

- Used step-by-step walkthrough to complete Hard challenge: add score

- Made a GameManager script that stored ‘score’ and reference to Player’s script component

- Incremented score by 2 when running faster, otherwise incremented by 1

- Made a GameManager Empty GameObject and attached the GameManager script component

- Published Unit 3 main challenge — Person jumping over obstacles

https://play.unity.com/mg/other/webgl-builds-63631

- Pretty sure I overwrote that with other challenge: Balloon game

Unity Day 53

- Watched the introduction to Unit 4 — Game Mechanics

- I’m excited to build this ‘Sumo wrestler’ game

- PowerUps and increasing difficulty looks fun to learn, struggle with, and implement

Unity Day 54

- Completed Lesson 4.1 in Unit 4: Watch Where You’re Going

- The camera rotates around a focal point based on user’s horizontal input

- Player moves forward and backward in relation to camera’s position

Practiced:

- Scripting

- Create 3D and Empty Objects

- Making one object the child of another

- Setting values in the Inspector that were declared as public from a Script

- Attached script to a game object

- Getting game object and component references programmatically

Learned:

- How to simulate a focal point and rotate the camera around it programmatically

- About Global and Local coordinate systems

- To always remember to set a value in the Inspector, otherwise it is 0 and the game appears to be broken

Unity Day 55

- Completed Lesson 4.2 in Unit 4: Follow the Player

- A sphere appears when the game starts in a random location on the platform

- It continually moves toward the player

- When colliding with the player, both spheres bounce off one another

Practiced:

- Creating and editing scripts

- Creating folders and game assets like Physics Materials and Prefabs

- Mapping assets to other assets like Materials to GameObjects and GameObjects to Script variables

- Setting values in the Inspector after declaring public variables in a script

- Using Vector3, GameObject.Find, GetComponent, transform.position, transform.rotation, Random.Range, Instantiate

Learned:

- How to return a value from a function

- About the ‘normalized’ property built-in to Vector3 data structures, likely getting the absolute value from any arithmetic calculation

Unity Day 56

- Completed Lesson 4.3 in Unit 4: PowerUp and CountDown

- A PowerUp game object appears on the stage at game start

- When the player collides with it

- A boolean is activated

- A countdown is triggered, expiring after 7 seconds

- The PowerUp game object disappears

- A similar-looking game object appears, tracking with the player’s movement

- When the player collides with another game object before the countdown expires

- The other game object bounces drastically in the direction that the player is moving (thereby appearing to bounce away from the player)

- When the countdown expires

- The game object tracking with the player disappears

Practiced:

- Using SetActive(true/false), Debug.Log and concatenation, floats, bools, GameObject and Rigidbody data types, AddForce(), transform.position, Vector3, CompareTag(), OnTriggerEnter, OnCollisionEnter, Collider and Collision data types, Destroy(), ForceMode.Impulse

- Hiding a gameObject when the game starts by unchecking its ‘Active’ box

- Creating Original Prefabs from an object in the scene that has been customized and configured

- Making a game object a Trigger via its Box Collider component

- Creating and applying Tags to game objects

Learned:

- About IEnumerator type functions, yield statements, WaitForSeconds(), StartCoroutine()

Unity Day 57

- Completed Lesson 4.4 of Unit 4: For-Loops For Waves

- Increasing number of randomly placed enemies appears once each wave of enemies falls off the edge

- Unless the player is pushed off, in which case no new enemies are spawned

- A new randomly placed powerup gameObject is generated with each wave

Practiced:

- Using public and private variables, GameObject data types, custom functions with typed parameters, Debug.Log(), short-hand increment syntax (++), logical comparison operator (&&), transform.position.y, Destroy()

Learned:

- For loops

- FindObjectsOfType<TYPE>() and its method, Length

- Publishing a game by way of installing WebGL Build package, adding the open scene, and pressing ‘Build and Publish’:

https://play.unity.com/mg/other/webgl-builds-65537

Project reflection:

- This was the funnest project to build

- After each lesson, I felt like I had applied several learned skills toward building a fun, simple game

- By the end, I understood 90%+ of the code and how it made the game behave as such

- This seemed easier to make than I may have otherwise expected, which is exhilarating

Unity Day 58

- As of publishing the last game, my Play.Unity.com profile features 10 published games!

- Downloaded starter files for Challenge 4: Soccer game debugging

- Completed all 5 required challenges

- Reversed operands in an arithmetic equation to cause enemy balls to bounce away form player

- Changed CompareTag argument from “Powerup” to “Enemy” so that a new wave spawns only when all enemies disappear

- Added StartCoroutine() with custom function as argument so that powerup would properly go away

- Replaced hard-coded upper limit from 2 to waveCount so that an increasing number of enemies would spawn each wave

- Updated the ‘speed’ value from the Inspector for each Enemy Prefab so that the balls would move toward the Player Goal

- Still to-do

- Enable the player’s ‘turbo boost’

- Increase the enemies’ speed? each wave as a form of increasing their difficulty

Unity Day 59

- Completed almost all of both Bonus challenges

- When the Spacebar key is pressed or held down, a smoke particle appears attached to the player ball

- Unfortunately, it moves with the ball’s rotation — instead of staying fixed between the ball and the floor

- I don’t think the ball moves any faster. This is likely because I’m not applying Force.Impulse to the correct Vector3 position. I need to do more research on identifying how to calculate a Vector3 position in the desired direction using a combination of the player’s Rigidbody component and GameObject

- Enemy balls gain 50 speed each wave, moving faster toward the player goal each wave

Practiced:

- Programmatically storing a reference to another GameObject’s script component from inside a GameObject’s script

- Define a variable whose type is the name of the Script component

- Give the variable any legal name

- On Start() set the variable to GameObject.Find(GameObject’sName).GetComponent<TYPE>();

- Then, use the variable to access any public properties or functions set on that script

- Storing a reference to a Particle by using the ParticleSystem data type

- (De)activating the ParticleSystem using Play() and Stop()

- Triggering code based on a key pressed or held through Input.GetKey(KeyCode.KEY) or Input.GetKeyDown(KeyCode.KEY)

- Applying force to a GameObject’s Rigidbody component using AddForce(Vector3, Force.Impulse)

- Completed Unit 4 quiz: 9/10

Learned

- When defining a function, the purpose of each word is as follows:

private float DoubleNumber(float number) { return number *= 2 }

- private defines how the function is namespaced — also, public if the function should be made available to other scripts

- float defines what data type is returned from the function — also, void if nothing is returned

- Title-cased label is the identifier of the function

- inside the parentheses is each typed parameter

- inside the curly braces is the body of the function

Unity Day 60

- Started Unit 5 — User Interface

- Watched introduction video with preview of final project

- Completed 3 of 7 tasks in Lesson 5.1 — Clicky Mouse

- Created a new project and imported all assets from starter files

- Toggled the Scene’s view mode to 2D

- Modified the Material associated with three game objects — background, left border and right border — to update the texture and color of each

- Added four different game objects to the scene, and for each one

- Renamed

- Added a Rigidbody component

- Added a Box Collider component

- Added a newly created Target.cs script component

- Updated the Target script to include

- Reference to each game object’s rigid body component

- Apply random force

- Apply random torque

- Set a random position

Unity Day 61

- Finished Lesson 5.1 — Clicky Mouse

- Completed 4 of remaining 7 tasks

- Refactored hard-coded values and enclosing function calls into declared variables that are referenced in custom defined functions

- Created Empty game object and corresponding script

- Added reference to List of <GameObject> assets

- Set the list to 4 in the Inspector and associated each Prefab with one of the slots

- Defined a custom IEnumerator function that…

- infinitely runs a while loop

- Waits 1 second

- Stores a random index to reference in the List

- Instantiates an object from the List using the index number

- Invoked the custom IEnumerator from Start() using StartCoroutine()

- Utilized two built-in event handlers in Target.cs

- OnMouseDown() to destroy the Target game object clicked

- OnTriggerEnter() to destroy the Target game object when it exits the screen? I’m not sure how this works

- Playtested the game to confirm objects spawn, disappear when clicked or exiting the screen

Practiced

- Setting the type of data returned from a custom function:

float FUNCTIONNAME()

Vector3 FUNCTIONNAME()

Learned

- List data types have a Count property, whereas Array data types have a Length property

Tutorials discovered to start later:

https://learn.unity.com/project/creator-kit-rpg

Unity Day 62

- Completed Lesson 5.2 — Keeping Score

- Created a Text Mesh Pro UI GameObject

- Adjusted alignment of the text game object

- Updated the text

- Setup GameManager.cs to store reference to the text object

- Mapped the text to the script in the Inspector

- Setup a score variable

- Updated text to display newest score

- Updated each Prefab

- Setup a pointValue

- Set point value in the Inspector

- Setup an explosionParticle

- Mapped particle texture in the Inspector

- Setup reference to GameManager script inside Target.cs

- Used the new UpdateScore function inside Target.cs

Practiced

- Using TextMeshPro in Unity

- using TMPro in scripts

- using TextMeshProUGUI data type and its text property

- using Instantiate, ParticleSystem data type, GameManager custom data type, GameObject.Find().GetComponent<>() syntax, StartCoroutine()

- Defining a custom public function with single parameter

Unity Day 63

- Completed Lesson 5.3 — Game Over

- Added and incorporated a Game Over screen with Restart button

- Correctly triggered display of text and button

- Correctly prevented spawning of game objects when text and button are visible

- Reloaded the game scene when the restart button is pressed

Practiced

- Creating custom functions

- Creating UI game objects

- Configuring text game objects

- Mapping game objects to components via the Inspector

- Using SetActive(), Button data type, bool data type, TextMeshProUGUI data type, CompareTag()

- Toggling a game object’s visibility via its Active checkbox

- Creating and assigning a new Tag to a game object

Learned

- About SceneManager and UI, two Unity APIs

- About a UI Button’s On Click event properties and how another game object’s functions can be mapped to one

Unity Day 64

- Completed Lesson 5.4 — What’s the Difficulty?

- Added Title Screen game objects including text and three buttons

- Adjusted game so the title screen game objects appear on scene load, then disappear after a button is clicked

- Adjusted the spawn rate to account for each button’s preset value

Practiced

- using UnityEngine.UI

- using custom data type for script components, int data type, Debug.Log, GameObject.Find().GetComponent<>() syntax, GameObject data type, shorthand syntax for updating a stored variable’s number value, SetActive()

- Setting parameters in custom defined functions

- Invoking public functions from other game objects

- Creating Empty game objects for use as a grouping mechanism of other game objects

- Setting values and mapping objects to script values using the Inspector

Learned

- UI Button game object’s onClick property and AddListener method

Unity Day 65

- Discovered newly released Head First: C# book that teaches C# using Unity

- Completed all but the bonus challenge in Challenge 5 — Whack-a-Food

- Used the Inspector and alignment buttons to fix the display of each difficulty button

- Updated the OnMouseEnter() function to OnMouseDown() to only destroy objects when clicked

- Replaced ‘score’ with ‘Score: ‘ + score; to correctly update the score

- Replaced the ‘false’ inside SetActive() to ‘true’ so the Restart button would display when Game Over

- Added int difficulty parameter to GameManagerX’s StartGame() function definition, and replaced hard-coded 5 value to refer to difficulty argument…all to ensure that objects are spawn at the appropriate frequency depending on which button is clicked when the scene loads

- Still need to add a timer to the game for the bonus challenge

Unity Day 66

- Read about Bolt, Unity’s relatively new visual scripting tool

- Completed bonus challenge: Countdown timer

- When a difficulty button is pressed and the game starts, the timer counts down from a predetermined number until the GameOver state is triggered (either by incorrect move, or timer reaching zero)

- Added two variables: boolean for isTimerActive, float for timer starting value

- Added Update() function

- Two conditions

- One to check if GameOver should be triggered — when timer is <= 0

- One to check both booleans (isTimerActive and isGameActive) — decrement the timer and update the UI to show the rounded value

- Used the hints provided to Google the right thing, then used the first search result to find sample code that guided me toward a working solution

- I struggled a bit since I started by using an IEnumerator and WaitForSeconds

- Then I refactored everything into the Update() function with a few conditions

- Completed Unit 5 quiz: 9/10

- Got tripped up by a question about string concatenation: I overlooked how a variable was incorrectly enclosed in quotes

- Started reading sample of Head First C#

Unity Day 67

- Followed instructions in Head First C#

- Downloaded and installed Visual Studio for Mac

- Created first project and ran it to display ‘Hello world’ in the console

- Completed ‘Easy’ challenge in Bonus exercise for Unit 5

- Implemented a ‘Lives’ counter wherein any time a ‘Good’ object wasn’t clicked, instead of triggering Game Over immediately, it decremented a preset Lives value which — once reaching 0 — triggered Game Over instead

Practiced

- Declaring typed values

- Mapping game objects to script components via the Inspector

- Writing a custom public function

- Writing conditional logic

- Play testing to diagnose bugs and confirm the game operated as expected

- Refactored code so that the logic was placed in the appropriate files and function definitions

Unity Day 68

- Skimmed the lessons in the final unit of Create with Code

- Performance improvements

- Namespace considerations

- Object pooling as a better way to spawn objects

- A tease of something called ECS as an alternative to object-oriented coding

- Mention of a Certification

- How to build and publish with WebGL and Mac/PC modules

- Not quite sure what Learn tutorial series I want to explore next

Unity Day 69

- Published Challenge 5 Whack-a-Food game to Unity Play

https://play.unity.com/mg/other/webgl-builds-70290

- Still unsure how to publish two different scenes from the same project to Unity Play

  • Publishing different builds only ever overwrites the previously published build

Unity Day 70

  • Published this Medium article chronicling my 70-day journey
  • Decided to no longer spend time each day learning Unity

--

--

Designer, Developer, DataViz, Dad • rmion.com

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Robert Mion

Robert Mion

Designer, Developer, DataViz, Dad • rmion.com