How do I change a int from a different script?
I am SO annoyed currently. I am trying to make a script that will access a different script varible:
public var otherGameObject : GameObject;
var anotherScript : Script;
function Awake ()
{
//anotherScript = GetComponent(AnotherScript);
}
So when I tried this part of the script (ignore the comment) I get a error: The name 'Script' does not denote a valid type ('not found'). Did you mean 'UnityEditorInternal.ScriptUpdatingManager'?
I looked all over Unity Answers and I get the same script I have now. SAME SCRIPT, SAME ERROR. Can someone please answer?
~ Thanks!
you have defined a variable anotherScript of type Script. If you have not created a class named Script, the compiler won't find it. this looks like a snipped of one class. what's it's name and what's the name of the other?
Your answer
![](https://koobas.hobune.stream/wayback/20220612100904im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Object reference not set to an instance of an object [problem with Unity 5] 2 Answers
Rotating & fixing the position of an object to one spot 1 Answer
How can i make a variable like the animator's parameters? 0 Answers
how to change the value of my slider(in the inspector) thanks 0 Answers
How to automatically generate a new int with a specific name? 1 Answer