O'Reilly logo

Virtual Reality Blueprints by John Williamson, Charles Palmer

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

ZombieController script

This script will be attached to the ZombiePrefab so that the behavior is applied each time an animated corpse is spawned. Take the following steps to set it up:

  1. Select the ZombiePrefab from the Project/Prefab folder and add a script component in the Inspector panel. Rename the script ZombieController.
  2. Move the script to the Scripts folder.
  3. Open the script in your editor and remove the Start () function. Since this script is a little longer, we'll break the description into parts:
 using System.Collections; using System.Collections.Generic; using UnityEngine; public class ZombieController : MonoBehaviour { 
     private Animator _animator; 
     private Rigidbody _rigidbody; 
     private CapsuleCollider _collider; private GameObject ...

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