Comprehensive World Streamer 2 Setup for Unity

Objective:

Manage the loading of interior components within buildings to optimize memory usage by loading them only when needed.

Why This Step is Important:

Loading all interior objects simultaneously with the exterior can lead to high memory consumption. Using collider streaming ensures that interiors load dynamically as players approach, enhancing performance and resource management.

Detailed Instructions:

  1. Organize Interior Objects:
    • Structure: Ensure all interior elements (excluding the building’s exterior) are nested under a single root GameObject.
      • Example: For each building, create an empty GameObject named Building1_Interior and nest all interior objects under it.
  2. Add Collider Zones:
    • Purpose: These colliders act as triggers that load or unload interior components when the player enters or exits their vicinity.
    • Creating Colliders:
      • Step 1: For each interior root GameObject, add a Collider component (e.g., Box Collider).
      • Step 2: Set the collider’s Is Trigger property to true to make it act as a trigger zone.
      • Step 3: Adjust the collider’s size and position to encompass the area where the player would trigger the interior loading.
  3. Assign ColliderStreamerManager Tag:
    • Purpose: Identifies the collider zones for World Streamer to manage interior streaming.
    • Procedure:
      • Select each collider zone GameObject.
      • In the Inspector, set the Tag to ColliderStreamerManager (created in Step 1).
  4. Add ColliderStreamerManager Component:
    • Purpose: Script that manages the loading and unloading of interior scenes based on collider triggers.
    • Procedure:
      • With the collider zone selected, click Add Component in the Inspector.
      • Search for and add the ColliderStreamerManager script/component.
  5. Link Interior Scenes:
    • Creating Interior Scenes:
      • For each building’s interior, create a separate scene containing all interior objects.
      • Naming Convention: Use a clear prefix, e.g., Building1_InteriorScene.
    • Assigning to ColliderStreamerManager:
      • In the ColliderStreamerManager component, assign the corresponding interior scene.
      • This links the trigger to the scene it should load when activated.
  6. Configure ColliderStreamerManager Settings:
    • Load on Trigger Enter: Determines if the scene loads when the player enters the collider.
    • Unload on Trigger Exit: Determines if the scene unloads when the player exits the collider.
    • Adjust these settings based on desired behavior.
  7. Repeat for All Interiors:
    • Perform the above steps for each interior you wish to manage via collider streaming.

Notes:

  • Single Root Object: Ensures that all interior objects are loaded and unloaded together, preventing partial loading.
  • Performance: Properly sized colliders prevent unnecessary loading of interiors, conserving resources.

Tips:

  • Testing: After setup, test each collider zone to ensure interiors load and unload as intended.
  • Optimization: Keep interior scenes as lightweight as possible to maintain performance during loading.