Untitled 3D Stacking Game: Code Sample


See demo video for Untitled 3D Stacking Game.
Below is a guided walkthrough of how the ‘objective HUD element’ (see image below)  was created in Unity 3D / Visual Studio.



2 scripts are responsible for this functionality:

fObjectives.cs
objectiveHUD.cs

These scripts keep track of objects resting on the plinth. If an object matches an objective (as defined in the script), the objective will be ticked in the HUD whilst the object is resting on the plinth. If all the conditions are met for a ‘main’ objective, the objective will be deleted along with its ‘sub’ objectives.



fObjectives.cs





objectivesHUD.cs


End of code sample. All content and ideas are copyright of Ivan Kashdan.