Delve into the Abyss Development Blog - Week 21
This week was a bit more interesting in terms of project work. After pitching my suggestion for making ores random it was decided to add that into the list of things to do this sprint. And since I came up with the idea, alongside having a rough concept of how the code would work, I decided to assign myself to the task in order to make the system work.
At first setting up the actual randomization was easy. I had to add all the ore prefabs to a specific list, and then the code will randomize a number based on the amount of objects within that list. From there it will then instantiate the ore at the position of the node, though at a randomize rotation to spice up ore placement variety. This was the easy part however. The hard part was connecting our mini-game to the actual ores.
What I ended up getting to work is that ores are instantiated on the Awake frame. Shortly after that, the ores' own code will search for the mini-game UI and plug that into their own inputs. Again, this all happens during the awake phase. Then, when we switch to the Start frame, the mini-game menu will disable itself as to not interfere with anything. While this appears easy, it took me about an hour and a half to get working since Unity has trouble detecting disable objects. Which is why I have to force disable the mini-game UI manually. Other than that however, I am proud of how this turned out and I look forward to seeing it be used fully in-game.
Comments
Post a Comment