Reader small image

You're reading from  Creating E-Learning Games with Unity

Product typeBook
Published inMar 2014
Reading LevelIntermediate
Publisher
ISBN-139781849693424
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
David Horachek
David Horachek
author image
David Horachek

David Horachek is a video game software developer with over 13 years of experience in programming arcade, home console, and portable games. He has programmed game projects published by Midway Games, EA, Ubisoft, SEGA, and others. He develops games under the Arbelos Interactive label.
Read more about David Horachek

Right arrow

Implementing the LevelLogicObj GameObject


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:

  1. 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:

  2. Make sure it has a Box Collider component and that the Is Trigger checkbox is checked as shown in the following screenshot:

  3. We want to use the DecisionMgr class to track the progress of the racers, which means we need to add an instance of npcScript to this object.

  4. Don't worry about the fact that the LevelLogicObj object is not specifically an NPC; if an existing tool is appropriate, don't reinvent...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Creating E-Learning Games with Unity
Published in: Mar 2014Publisher: ISBN-13: 9781849693424

Author (1)

author image
David Horachek

David Horachek is a video game software developer with over 13 years of experience in programming arcade, home console, and portable games. He has programmed game projects published by Midway Games, EA, Ubisoft, SEGA, and others. He develops games under the Arbelos Interactive label.
Read more about David Horachek