Micaella Langit's profile

Micaella Langit 2021 VFS Portfolio

Micaella Langit 2021 VFS Portfolio
<!--- Contacts: micaella24@hotmail.com / +1 (431) 556-9414 / @thenon_artist1724 --->


<b> Game Design Group - Winter is Coming </b>
<h3 style="color:Blue;"> Clickable Objects - Unity2D </h3>
<h4 style="colour:Purple;"> I thought of this project for CBC Kids, before being told what our contract will be with them. It is a game I designed to be an interactive puzzle game that will teach kids how Canadian Animals get ready for winter. I was learning all the basic mechanics during the start of this project, watched a ton of unity videos, and had to re-learn coding because of how different the style for Unity is compared to text-based. My accomplishment is studying how to make an object, clickable, and understanding the theory behind how it works before testing it out. What I have to show is all my accomplishments in basic understanding, maneuvering, and creating in Unity. </h4>
<!--- A short video of my accomplishment - needs to be uploaded still --->
h4 style="colour:Purple;"> The main mechanic of my game is clicking on objects, which causes events to trigger. In order to do this, I needed to learn how to create clickable objects using script. Through watching tutorials, I understood that we could get the position of the mouse, and via raycast, check if it is clicking on an object. I learned how to code this through checking if what was clicked was, in fact, the object the code was attached to. I mostly used the method isClicked() for the main code. This is found in the ButtonActivation class.

isClicked() works by first checking the position of the mouse. Because we are in Unity2D, but the code I used stores its position in Unity3D, I had to convert it. After converting the position into a 2D vector, I used the raycast code to check if the mouse, at that certain position, is clicking on an object with a collider. If a collider is detected, and the collider belongs to the objects connected to the script, then the code returns a boolean indicating if that object was clicked or not.

I also used a method called toNextScene(), which I coded and learned how to navigate between different scenes. Although the code for this function is really short, I understand whats happening and how it works. I managed to connect the Scene Index to every object, and got this code working exactly how I wanted it to.

Together, both functions work to change the scene depending on what the object is connected to. I want to separate this into different classes, or maybe turn isClicked() into a function that triggers a Unity Event. At this point, because I was learning the basics, I was unable to complete everything. The projects for CBC Kids changed, but I'm still determined to get this game done one day.  </h4>
<!--- This class checked, via raycast, if the object was clicked. If yes, it changes the current Scene to the attached scene --->
<b> Virtual Reality Group - TeaM ABRACKADABRA </b>
<h3 style="color:Blue;"> Phone System - Unity3D </h3>
<h4 style="colour:Purple;"> In this project, I am the main (and only) technical crew. I am to code everything that needs coding, as well as put everything together in Unity. What I will be showing is my most recent accomplishment I felt proud of for this project; a working system on our flip phone. My team wanted us to be able to view applications on the flip phone, as well as use the camera feature (with certain items hidden). Through this accomplishment, I learned how to code in Unity, use Unity Events, play with layers, and overall get a feel on how Unity works in general. </h4>
<!--- A short video of my current accomplishments --->
h4 style="colour:Purple;"> In order to learn Unity Events (which is what my mentor told me to do), I coded it how you see below. 

First, we have the ButtonActivation class, which determines if you clicked the object we want to invoke an Event on, and runs the Unity Event script. When the mouse button is down, it checks the position of the mouse and if the mouse hits anything. If it hits the GameObject the script is connected to, it will invoke the Unity Event that we add onto the script using the inspector. This way, the non-coders (everyone else) in my team are able to drag and drop whatever we need in its correct position.

Next, we have the PhoneMechanics class, which deals with the Flip Phone's screen. I created an array of GameObject's, which have items that deal with the flip phone's screen. The 
GameObject we will be dealing with are raw images. It is a SerializedField because we want my team, who all do not code, to be able to drag and drop items into the array without having to code it in. I also created three functions: backSelect(), frontSelect(), and selectItem(). 
backSelect() will go through the array backwards, meaning with the index counting backwards. This has to be different because of some technical issues with the index going into the negatives. It will deactivate the previous GameObject, and show the current GameObject instead.
frontSelect() will go through the array in order. It will also deactivate the previous GameObject, and show the current GameObject. 
selectItem() is the final function I created in this class. When set to a certain image (with a certain index) and the middle button is clicked, the screen will show a different GameObject. In particular, when the index is 3 (or the 4th option, which is a picture of a pig in this case), the GameObject showing will be connected to a different camera than our main camera, and acts like the flip phone has its own camera. 

When you put both classes together and connect them to a GameObject that will act as a button, the Inspector will show that we are able to connect both scripts. The screenshot shows that there is a box collider connected to my up arrow button, and when the up arrow is clicked, it will activate the backSelect() function. The same goes for the down arrow with the frontSelect() function, and the middle button with the selectItem() funciton. The result is the video above. </h4>
<!--- This class determines if the object was clicked on. If yes, it will invoke a Unity Event --->
<!--- This class goes through the GameObject array, and will Activate what needs to show while deactivating the previous item --->
<!--- For the object of which invokes a change, I have included both scripts. They work together to go through the GameObjects --->
Micaella Langit 2021 VFS Portfolio
Published:

Micaella Langit 2021 VFS Portfolio

Published: