title: How do I access a custom property from another component in Unity
body: <p>How do I access a custom property from another Unity component?</p>
  
  <p>In my Avatar component I have declared the variable like this:</p>
  
  <pre><code>public var isInEndzone : boolean;
  </code></pre>
  
  <p>Calling the property from another component:</p>
  
  <pre><code>//actor variable is the GameObject that has the Avatar component.
  public var avatar : GameObject;
  
  ....
  
  var avatarComponent : Avatar = avatar.GetComponent(Avatar);
  if (avatarComponent.IsInEndzone){
  //do something...
  }
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>GetComponent requires that the requested component 'Avatar' derives from MonoBehaviour or Component or is an interface.
  UnityEngine.GameObject:GetComponent(Type)
  
  BCE0019: 'IsInEndzone' is not a member of 'UnityEngine.Avatar'. 
  </code></pre>