Search Unity

Best method for passing info to new scene

Discussion in 'Scripting' started by fredastaire, Dec 28, 2018.

  1. fredastaire

    fredastaire

    Joined:
    Sep 10, 2017
    Posts:
    90
    I’m working on a racing game and need to pass data (time trial) rankings from the qualifying scene to my heat race scene. So as an example 40 cars set time and I want to break it down to ten cars in each heat race with the fastest car starting in last and slowest first any direction would be greatly appreciated.
     
  2. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    If you only need it this one time and don't need to save it for anything else i'd just stuff it in a static variable.
     
  3. RustyCrow

    RustyCrow

    Joined:
    Feb 28, 2014
    Posts:
    43
    Check this out GameManager. Maybe you can use a similar idea. Have a Gameobject that dosent get destroyed and fill it up with the times. Then use them in the next scene.
    I think you can find some real good information if you search for "unity store data between scenes" There are a lot of opportunities for you, but i think for what you are asking a Gamemanger type object would suffice.