Accessing other GameObjects Script Variables

Hi there! I am kinda new at this but i have a script here. But i always get a NullReferenceException Everytime i start up the Game :(. I want my Script to Access Other GameObject Variable.

Any Ideas to fix it :)?

  • Yohan

http://docs.unity3d.com/Documentation/ScriptReference/index.Accessing_Other_Components.html

http://docs.unity3d.com/Documentation/ScriptReference/index.Accessing_Other_Game_Objects.html

var OtherComponent : Component ;

OtherComponent = gameObject.GetComponent ( ScriptName ) ;