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. Dismiss Notice

How to reference a public variable from a script in one scene, in a script from another scene

Discussion in 'Scripting' started by Lil_Potatoe, May 29, 2021.

  1. Lil_Potatoe

    Lil_Potatoe

    Joined:
    Feb 2, 2021
    Posts:
    16
    Hey, so I have a public bool variable in a scene, that is true depending on if a button was clicked. , and I want to check if the variable is true or not in another script in a separate scene. I've read other forums with similar problems but I am still a bit confused on the matter. Thanks for any help and let me know if you need my scripts.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,756
  3. Lil_Potatoe

    Lil_Potatoe

    Joined:
    Feb 2, 2021
    Posts:
    16
    Kurt-Dekker likes this.