
Project Overview
Engine: Unity 2022.3.43f1
​
Programming Language: C#
​Role: Game Developer and Game Designer
Duration: 2 weeks
​
Status: Complete​​
In this short demo clip you spawn in as a ball in a very quickly constructed level I designed using Unity's free plug-in ProBuilder.
It was very useful for creating unique level design in the engine.
Gameplay Video
Design and Development
Purpose
This project was created as a way to help others just starting off learning Unity during my time as a Unity Instructor. It touches on all the basics of C# programming and the fundamental concepts around the Rigidbody component which deals with game physics. This is a project I am proud of because I have used this project in lessons to help teach others 3D C# programming and Unity Game Development. The game loop is simple collect all the coins to activate teleporters to progress through the game.


Game Mechanics
I wanted to make this project something easy to learn for my students at the time to learn. Most of them were middle school students and some high school students. So I decided to create a simple game loop that would incorporate some key learning aspects for beginner level students. Simply put collect all the gold coins and a portal will appear to take you to the next area once you've collected them all the player wins the game.
The gameplay style is 3rd person. The player starts off at the first part of the level. The movement for the player uses the rigid body component to help create physics in the game. I created variables for the horizontal and vertical input for the player, and then in the FixedUpdate() method I initialized them to get the horizontal and vertical axis. I created a Vector3 variable to create a brand new velocity for our player and use AddForce so that the movement wouldn't be immediate and would actual simulate ball movement.
In the OnTriggerEnter() function when the coin collides with the player it will destroy the coin game object and call on the AddScore() function to update the score ui.
The SampleCoinScript AddScore() is a custom function I developed for increasing the score count ui. This function calls on the ScoreManagerScript and updates the score by adding the value of the coin to the score. pointValue is a public variable so the point can be changed to any number.
I wanted to make it rewarding for the player when they collect coins. In the SampleTeleporterScript I programmed it to appear when the player reaches a certain amount of points this made the teleporter game object prefab very easy and simple to reuse in other sections.
​
There was a significant issue I had with the teleporter. The straightforward design was that it transported a object from point A to point B, but the teleporter is also the end goal so it needs to be able to transition between scenes as well.
I designed the camera system in my ball game to have 3 different cameras. I created a variable that will keep the cameras in a list and created KeyCode variables for the specific camera view the player can choose from.
I used a for loop to run through the entire CameraList, and set it so that all cameras are always facing the player. That way I don't have to worry about apply one script to multiple cameras and instead just put it on one game object controlling all of them.

My thought process when developing this was to have it so that depending on if I wanted the player to go to the same scene or a different scene. I can use a switch statement for this because I can check for the type of teleport it is based on the enum variable State.
​
In the case If the player is going to teleport in the same scene and if the teleporter is activated through the points acquired the player would then be transported to the end position which is the Teleport2 variable, but in the case if the label is next scene. The game will then update to the next level in the build settings index.