1. What is wrong with this? : )

    Code:
            void OnTrapSnapped(BaseTrapTrigger trap, GameObject go)
            {
                Puts("Trying");
                if (go.GetComponent<BasePlayer>() != null)
                    if (factionData.Players[go.GetComponent<BasePlayer>().userID].faction == factionData.Players[trap.GetComponent<BaseTrapTrigger>()._trap.OwnerID].faction)
                    {
                        Puts("Success");
                        trap._trap.GetComponent<HitInfo>().damageTypes.ScaleAll(0f);
                        Puts("Tried SCaling");
                    }
            }
    I get to Success but fail on changing damage scale.
     
  2. Hitinfo wouldn't be a component of the trap. Check for damage in OnEntityTakeDamage and check if the initiator is your trap type
     
  3. damn you.. why does it have to be so simple.
     
  4. To further elaborate on this.
    HitInfo is basically just a class to store information to pass on to other methods, it does nothing on its own. When a entity needs to take damage a new HitInfo is generated with the appropriate information and is sent elsewhere to deal damage.
    GetComponent is used to retrieve components of the specified type attached to the game object, that are - or are derived from - a MonoBehaviour, if the type you specify is not in some form a MonoBehaviour (which HitInfo is not) or ofcourse if the type is not a component of the game object it will just return null