public void OnTriggerEnter2D(Collider2D hit) { if (hit.gameObject.tag == "actor") { if (!onPlatform) { line.getRidOf(hit.gameObject); hit.gameObject.GetComponent <Squashable>().squash(); barrelSmashSound.Play(); } } }