public void OnTriggerEnter2D(Collider2D other)
{
//When on a moving platform
if (other.gameObject.tag == "moving")
{
transform.parent = other.transform;
}
//Fall Death
if (other.gameObject.tag == "floor" || other.gameObject.tag=="imp"|| other.gameObject.tag == "moving")
{
if ( rb.velocity.y <= -25.0f )
{
OnDeath();
}
}
if (other.gameObject.tag == "Untagged") {
RunnerBarrier barrier = other.gameObject.GetComponent<RunnerBarrier>();
if (barrier != null) {
if (!charging && (mobFacingRight != barrier.goRight)) {
Flip ();
facingDir = new Vector2(-facingDir.x,facingDir.y);
}
}
}
if (other.gameObject.tag == "explosion") {
OnDeath ();
}
}