O'Reilly logo

Getting Started with Unity by Patrick Felicia

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

Creating and updating prefabs

Let's add a red dot to the prefab zombie_idle, so that any zombie can be detected on the mini-map. Perform the following steps:

  1. Create a new sphere, rename it dot_enemy, set its size or scale to (x=2, y=2, z=2), remove its collider component, apply the Red texture to this object (this texture is located in chapter4 | chapter4_pack), and set its Layer property to topView.
  2. Set the shader of this object to Self-Illumin/Diffuse and duplicate this object.
  3. Drop the first duplicate, dot_enemy, on the object labeled zombie_hires in the Hierarchy view and change the position of the object dot_enemy to (x=0, y=0, z=0).
  4. Drop the second duplicate, dot_enemy, on the object labeled patroller in the Hierarchy view and change the position ...

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