Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Link to the Past type time changing

Discussion in 'Scripting' started by Ray4PREZ, Jun 25, 2014.

  1. Ray4PREZ

    Ray4PREZ

    Joined:
    Apr 13, 2014
    Posts:
    3
    I would like a script that, when on command, you can change how the room looks and how objects work.

    If I were in a room, and I was stuck behind a wall, I would need to change to the future when the wall is destroyed.

    Also, things in one time period would carry over, so if you cork a waterfall in the present, then in the future, the waterfall wont be running. Then the player might be able to go behind the waterfall and go into a door, or something along those lines.
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,744
    So.... what's your question?

    Or, to answer more directly: This isn't one problem. This is a thousand little problems. Pretty much every object is going to require its own logic for how it behaves in past vs. future. The corking-the-waterfall thing, for example, is logic that you're not gonna be able to reuse anywhere else.

    The only way we could provide you with such a script would be to script your whole game for you.
     
  3. Ray4PREZ

    Ray4PREZ

    Joined:
    Apr 13, 2014
    Posts:
    3
    I know that, and I also know JS.
    The question is just how would I go about it.
     
  4. GarthSmith

    GarthSmith

    Joined:
    Apr 26, 2012
    Posts:
    1,240
    I imagine that you would have a DualWorldThing (or similar) class that has references to two objects, the "light world" version and the "dark world" version.

    Two ways from here.
    1. They share data. So if there is a door in both worlds, and a bool doorOpen is true, then both object's doors will be open.
    2. If something happens to one version, the other version is notified. The DualWorldThing class would manage these messages and pass them back and forth between the two objects.
    Now all the different specific things that need to be done like corking a water fall or filling in a pit or whatever... those should be dealt with in a case-by-case basis.