Hello! Here is a recap of yesterday, Day 31 of my 60 day challenge to become a Unity Game Developer :)
Today I did a little bit of work on my game but mostly focused on doing Unity game challenges. This gave me an opportunity to work with some of my teammates to try and solve these challenges. Yesterday was a good reminder of what I love about programming. Every idea, every feature, these challenges, they’re all basically just puzzles that need to be solved. The process to get there is engaging and working with my teammates to figure it out was super fun. Working on a good team always makes for an awesome time and its interesting to see how everyone approaches the same problem.
Here was one of the challenges:
Here is how we approached it:
First we took a look at the game scene and hierarchy to inspect what was provided as our base for the challenge.
After that we could then start to think about what we needed to do. To keep things organized and to ensure that we thought everything through, the first thing we did was write out what needed to be done in pseudocode.
Looking at the problem we knew that we would need to create scripts for our rotator, launcher, and ball.
From looking at the challenge we knew that for the launcher script we needed to figure out a way to instantiate the ball, make sure that when the ball is instantiated it does so at a rate of 1 sec, and that it shoots in the direction of the launcher. Here is what we came up with:
One issue we came across was making sure that the ball was instantiating from the launcher at the right point. Luckily, another teammate was able to figure out that by creating a separate transform component we could then set it’s position to the position of the launcher which is what the _ballSpawnPoint transform shown above does.
For the rotator script all we needed to do was set the rotation and create a speed variable to set the speed.
Here is the ball script:
This is what moves the ball forward as well as destroys the object 2 seconds after launch.
After recapping this it all seems very simple but to be honest it took a lot of teamwork, some googling, some reviewing past projects in order for us to have solved this challenge. It was very rewarding and look forward to keep working on these challenges both with my teammates as well as on my own.
- Still a bit behind in my game. Will work on it this weekend and hopefully be all caught up and have it completed by early to mid next week.
Today I will be working on finishing all of the cutscenes for my cinematography game!
See you soon.