Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Alternating between levels with similar content

Discussion in 'Scripting' started by Herculess, Nov 20, 2014.

  1. Herculess

    Herculess

    Joined:
    Nov 20, 2014
    Posts:
    2
    Hi everyone. I've done some thorough research on alternating between levels but none of it seemed applicable to my current situation. My character has the ability to 'Astral project" in which I would like my current state of the level to be transferred to another level where the player would then forecast and predict his next move before returning to the actual game level. When the player astral projects, the level which he transitions to shouldnt affect the actual levels objects.

    Does anyone have a simple solution to this or could guide me in the right direction? Any help will be greatly appreciated
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    You probably want to avoid a pause when switching into and out of astral projection, so don't load levels to switch. Here are some suggestions:
    • Keep both versions (physical and astral) in the same scene. You could organize one under a GameObject named "Physical" and the other under a GameObject named "Astral".
    • To keep them separate, Astral could be offset by (1000,1000,1000) or whatever's appropriate in your game.
    • Use prefabs heavily so changes to one map will carry into the other.
    • If your maps are complex and computation-heavy, you could keep one map active and the other inactive. When you switch, sync up the maps.
    If you don't want to maintain two versions of the map (Physical and Astral), you could try to use the same map for both. When switching to astral projection, use different shaders and/or post-processing effects (and don't underestimate the effect of background noise -- think of the windy sound when Frodo puts on the One Ring in the LoTR movies). You can use one of the time-rewind products on the Asset Store or write your own. Let time move forward as your forecast the move, then rewind when you switch out of astral projection.
     
    JoeStrout likes this.