When instantiated, the LevelLogicObj
object will be detected as soon as the player and racers enter the LevellogicObj's trigger volume. When three racers have crossed the finish line, it will determine if the player has met the objectives of the race or not, and it will enable either the pass or fail retry pop up. In order to implement the LevelLogicObj
object, we need to perform the following steps:
Create a cube game object named
LevelLogicObj
. Scale, orient, and position it so that it surrounds the finish line in the level as shown in the following screenshot:Make sure it has a Box Collider component and that the Is Trigger checkbox is checked as shown in the following screenshot:
We want to use the
DecisionMgr
class to track the progress of the racers, which means we need to add an instance ofnpcScript
to this object.Don't worry about the fact that the
LevelLogicObj
object is not specifically an NPC; if an existing tool is appropriate, don't reinvent...