- Home /
How can I make Game Objectives?
Once again, I am making a creepypasta game called "Cupcakes" but I need help with the Game Objectives.
It's like When the game starts, The objective is set to visit Pinkie Pie for her special occasion (by simply walking to her)
How can I do that?
Answer by bilo-lwabona · Oct 31, 2013 at 01:49 PM
Hi
For this particular game objective, you might want to have a script that initialises the objective. To check for the completion of the objective, you could use a volumetric trigger that fire a "game objective completed" event (for this particular objective) when the player object enters it.
The above solution is quite specific though. For something more generic, you could create a singleton ("ObjectiveController") that creates all the objectives, (i.e. gives them to the player). Then, whenever a task is completed (e.g. walking into a trigger, reaching a particular score, surviving for a specific duration, etc.) any one of these scripts ( which check objective completion) could access the "ObjectiveController" (singleton) and complete the event.
There are many ways to go about this ... I just provided a solution, which is fairly straight forward (in my humble oppinion). Hope this helps!
Cheers
Bilo