I defined a public int in a script
public int onEvent = 0;
and then I tried to use it directly in another script file in a code like:
if(Input.GetKeyDown(KeyCode.Return) && onEvent == 0){...}
It didn’t work. I defined another int in the second script file with the same name, but it instead created two different ints with same names.
What do I have to do to call the same integer from a different script file?