/// <summary> /// When collider is triggered we are checking if it was a Player1 Object - If it is we make the text appear as well as /// making the coin pickable /// </summary> /// <param name="collision">The collision component of the object that is colliding with this object?</param> private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.name.Equals("Player(Clone)")) { collision.gameObject.GetComponent <Player.Player>().DestroyMoneyBag(gameObject); moneyManager.CMDCollectMoney(collision.gameObject.GetComponent <Player.Player>().GetTeamId()); } }