Tuesday, March 2, 2021

Unity Tutorial 05

 

I remember mentioning a few weeks back wondering how we’d be managing the camera for this tutorial since  the map of my game was off-centred. This tutorial had the answer. Rather than having a static camera of the whole map, we set it up so it would follow Ruby on her journey.  Having the camera zoomed closer to Ruby made a big difference in the play experience which I felt made the game more immersive allowing for the player to explore the world rather than getting  full-picture view.  This tutorial showed us how to look for Unity Packages which are pre-made bundles of  code that can help remove a lot manual workload in scripting and behind-the-scene math work.  The camera package we used for this tutorial is Cinemachine which allows you to make interesting cuts and set-ups between multiple cameras similar how you’d see in movies. However, for this tutorial we set the camera in orthographic mode since we are working in 2D, having the objects appear the way they are rather than in perspective mode where objects would pear smaller the farther the distance.  We also learned to add  boundaries to our game by using the  existing water tile set-up from previous steps which Ruby already knows not to walk over. All that was needed was to add a confiner extension component and link it to 2D polygon collider to set the boundary.


Screenshot of my progress in Unity


Second part of this week’s tutorial I spent some more time messing with Unity’s  particle system settings. We briefly went over particle effects last semester but this semester were introduced to some of looong list of settings and options available to alter the sprites so they can look more realistic witch fading smoke effects and adding variety to shapes. I decided to experiment the second one on my own.  The idea was to add an explosive burst of star particle once the smoke is gone and the r obot is fixed. Creating the particle wasn’t hard, it does take a while to get the desired effect however. It was telling the script when to apply the effect that can be confusing. I tried write the opposite  line of code in the Fix function of the enemy controller script:

Stars.Play();

Unfortunately, the effect still plays as soon as the game starts. I may need to mess around with Unity more in order to figure out where I’m going wrong.  Overall, it was fun to figure out how the particles worked.



Embracing the chaos in Unity


No comments:

Post a Comment

Doing

  We are nearing the end of this semester and the book we’ve been working throughout the semester is in its final editing stages. This week,...