My ontriggerenter2D is triggering 3 times(instantiating 3 objects), even with me destroying the other object before everything else.
private void OnTriggerEnter2D(Collider2D other)
{
if (other.tag == "ShieldPickUp")
{
Debug.Log("trigered");
Destroy(other.gameObject);
GameObject shieldPU = Instantiate(_shieldPowerUp, transform.position, Quaternion.identity);
shieldPU.transform.parent = this.transform;
Instantiate(_shieldTimerSlider, _healthBarCanvas.transform.position + new Vector3(-400, -240, 0), Quaternion.identity, _healthBarCanvas.transform);
_playerDamager.isPlayerShielded = true;
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…