O'Reilly logo

Creating E-Learning Games with Unity by David Horachek

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Connecting SplineMgr to NPCScript

To prepare a spline curve to be used by the splineMgr class, we can perform the following steps:

  1. Create an empty GameObject, and set its position to (0,0,0). This will be the parent node to the collection of waypoints. Name it something appropriate, such as curve1.
  2. Create a series of spheres named waypoint1, waypoint2, and so on. Note, we use GameObjects instead of empty objects so that we can enable the mesh renderer on the nodes if debugging or visualization is necessary. Our system will require a minimum of five points and two segments.
  3. Arrange these points in the editor so that they form an appealing curve that meets your needs. Note that we interpolate the position of the waypoints only, so rotating them will ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required