Answer the question
In order to leave comments, you need to log in
How to exchange variables between scripts in Unity C#?
Hey! Yes, a rather stupid question, but I searched the entire Internet ...
True, I did not find anything.
What do we have?
We have the first code attached to the button (a separate object in the canvas)
And the second, which, as planned, should take the value of a certain variable and move the object.
In theory, in the first one, on pressing, the value 1 will be assigned to a certain variable, and the second code will check the value of this variable.
And so, the question is:
How to exchange variables between scripts in Unity C#?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question