Forum rules - please read before posting.
Tech questions during the weekend? Drop in on the community Discord channel!

GlobalVariables could not be found -Are you missing a using directive or an assembly reference?

edited May 2014 in Technical Q&A
What is wrong with this code (with the changes to AC scrit)

IE= GameObject.FindwithTag(Tags.persistenteEngine).GetComponent <GlobalVariables>().GetIntegerValue (1);

GlobalVariables are not recognized


  • I Read that you changed GlobalVariables back to RuntmeVariables

    and changed that

    But now i am getting error CS0176 : Static member "RuntimeVariables.GetIntegerValue(int)" cannot be accessed with an instance reference, qualify it with a type name instead

  • I apologise for the script changing, but in fact the GlobalVariables class is still the right one to use - but they're static now meaning the syntax is easier.  This tutorial has the full list of functions available, but the corrected line you've posted would be:

    int value = AC.GlobalVariables.GetIntegerValue (1);
  • Worked like a charm, thanks Chris
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.
Do NOT follow this link or you will be banned from the site!