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

Adding NpcRacers to the mission


To make the race compelling and interesting, we will create two NPC racers to challenge the player. If it turns out well, we can build most of these with the technology we have already developed.

Each racer will need a spline to follow. Recall from the previous chapter that we developed a system for placing waypoints in the scene and using the SplineMgr script to generate a smooth curve for an NPC to follow. This will define the smooth path they traverse from start to finish. To implement the other racers in the level, carry out the following steps:

  1. Create an empty GameObject, and name it _splineDataA. Create a series of sphere game objects, and place them in a path from start to finish. Disable the mesh renderer of these objects, and then parent them all to _splineDataA.

  2. Create a second _splineData object with different path nodes so that the second racer will follow a similar but not identical route through the course. Name it _splineDataB.

  3. Parent these two...

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