Moving to other levels

Finally, let's see what we can do to make the changes we've made in this chapter show up in all of our levels. We perform the following steps:

  1. We've been modifying a series of prefabs, so thankfully, it's quite easy to update them for other levels. Select the FPSController object and in the Prefab section, click on the Apply button to save our changes to the prefab.
  2. The Ghost object, however, is just a model, so let's open the Prefabs folder in our project browser and drag and drop the object in there.
  3. Finally, we will also need to bring over our Camera Canvas, so to make it easier, we will rename it to Camera Canvas and make it a prefab as well.
  4. Now that we have everything set up, let's open our interior level.
  5. First of all, let's bring in the Camera Canvas since its position doesn't matter.
  6. Next, add in our player by going to the FPSController prefab and then dragging and dropping it into our world. From there, open up the FPSController and select the FirstPersonCharacter prefab and then assign the Phone Border and Camera Flash variables within the Phone Behaviour component.
    Moving to other levels
  7. Then, you can drag and drop a Ghost prefab into the scene at a place of your choice and set the Enemy Behaviour object's Target property to the FPSController object.
  8. After this, save the project and play the game. Take a look at the following screenshot:
    Moving to other levels
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset