Search Unity

How to acces a variable of another script from another scene?

Discussion in 'Getting Started' started by Samuel014, Feb 8, 2019.

  1. Samuel014

    Samuel014

    Joined:
    Nov 26, 2018
    Posts:
    2
    Ok, very simple question. ScriptA looks like this:
    public bool myBool = false;


    How do I set
    myBool
    to
    true
    in scriptB, if scriptB is in another scene than scriptA?
     
    Last edited: Feb 8, 2019
  2. AdrianHil

    AdrianHil

    Joined:
    Feb 1, 2018
    Posts:
    26
    Joe-Censored and Ryiah like this.