How do I access another script in Unity C# 2018.2?
I have searched through many others questions and all have given relatively the same answer, but none seem to work. What I'm trying to do is simple, just change the value of a variable in another script, but yet VS doesn't seem to like it. Whenever I put the name of the referenced script in the <>, it always gives me an error asking if I'm missing a directive or an assembly reference. All classes are public so that's not the issue. The only explanation is that in the time I've been away from making games (about a year) Unity changed up the syntax in some way. Any help would be greatly appreciated!
No, Unity didn't change the way to retrieve the components. $$anonymous$$ake sure to specify the namespace if needed.
Try to
Close Unity
Delete the
Library
folder (andTemp
folder if exists)Open Unity and let it reimport your project
You may also have to reinstall Unity.
Your answer
Follow this Question
Related Questions
Reference a script on a gameobject that is disabled in scene 0 Answers
Is it overkill to RequireComponent then check if GetComponent isnt Null in Awake? 1 Answer
How to pull a variable from a separate C# script. 1 Answer
Pass a value between script or else by reference? 1 Answer
Object reference; sometimes works but sometimes doesn't??? 2 Answers