Creating Zones¶
There are multiple ways you could create zones. This is just an example of how I like to do it. This guide will show you how to setup a stationary camera zone. For additional reference, check out the demo scene and examine how each zone was setup.
1. Create The Zone Object¶
- Begin by creating a empty game object called Camera Zones. This will keep all of your zones organized.
- Remember to zero out your empty game object if not already done.
- Add a plane to your Camera Zones, rename it to something meaningful
- Remove the mesh renderer component from the plane
- Change the mesh collider to convex and check the is trigger box
- Scale and position the plane in your scene, if the player is anywhere inside the trigger the zone will be active
- You should now have a scene without a layout like this. Obviously your scene will look different.
- Add a new empty gameobject with your zone as the parent, named Camera Position
- In your scene view, position your view to how you would like the camera to look. In this example I zoomed in on the zone, with a slight overhead view
- Select the Camera Position game object, then select game object->Align With View from the File Menu
2. Assign The Zone Object To The Zone Game Manager¶
- Drag the Zones prefab located at Assets/MagaericSolutions/Prime Ball Controller/Prefabs into your scene hierarchy
- Select the Zones object and find the Zones Game Data under the Zone Game Manager Script Component
- Click the plus sign to add a zone, or modify the existing Template zone
- Give the zone a name
- Drag the zone plane you created back in section 1 step 3 into the Zone Area
- Drag the zone camera position you created back in section 1 step 8 into the Stationary Camera Position
- Change the Camera Type to Stationary
- Your finished zone should look something like this
Your zone is finished.