Forum rules - please read before posting.

Making GVAR public causes an error

As the screenshots show, global variable 126 changes into 0:(untitled) when made public as a GVar

https://ibb.co/RcNKLJr
https://ibb.co/Ns3MPfW

Unity 2022.2.21
AC 1.77.3

Comments

  • edited June 2023

    Variable assignments need to be made within functions - not as part of their declaration.

    Move these to your Start function, i.e.:

    public GVar Currentstatnumber;
    
    void Start ()
    {
        Currentstatnumber = GlobalVariables.GetVariable(126);
    }
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.