title: How can I run a method on one script from another? [UNITY 3D] C#
body: <p>I have 2 scripts: WeaponAttack and an AnimationEventManager.</p>
  <p>this is the 2 methods from WeaponAttack</p>
  <pre><code>public void EnableCollider()
      {
          
          Debug.Log(&quot;collider enabled&quot;);
          isAttacking = true;
      }
      
      public void DisableCollider()
      {
          
          Debug.Log(&quot;collider disabled&quot;);
          isAttacking = false;
      }
  </code></pre>
  <p>and these 2 methods are from the AnimationEventEditor</p>
  <pre><code>public void StartAttackCollider()
      {
          
          weaponAttack.EnableCollider();
           
      }
  
      public void StopAttackCollider()
      {
          
          weaponAttack.DisableCollider();
          
      }
  </code></pre>
  <p>Id like to use animation events to turn the box colliders on and off using the Enable and Disable Collider methods inside of WeaponAttack but with what I currently have written I get an object reference error that weaponAttack is not set to an instance of an object. Ive been scratching my head at this all day and can't figure out what I should do lol, if you know how I can fix this pls lmk! thanks!</p>