void OnCollisionEnter2D(Collision2D col) { if (!playerStateScript.GetIsSuffocating()) { //figure out what player/team this instance is, and check if it's colliding with the enemy team players if (col.gameObject.tag == "Player") { enemyPlayer = col.gameObject; //current player is beaverSprite // enemyInputScript = enemyPlayer.GetComponent<get_input>(); enemyStateScript = enemyPlayer.GetComponent <player_state> (); //only want players of opposite teams if (playerStateScript.GetTeamNumber() != enemyStateScript.GetTeamNumber()) { //TODO: case for both have dash on if (enemyStateScript.GetIsDashing() == true) //enemy has dash on //player becomes immobile and drops the pearl in the direction of impact { damageScript.Damage(); //knockback the other player (This player) //StartCoroutine(Knockback(beaverSprite, 1f, 350, beaverSprite.transform.position)); } } } } }
void OnCollisionEnter2D(Collision2D col) { if (!playerStateScript.GetIsSuffocating ()) { //figure out what player/team this instance is, and check if it's colliding with the enemy team players if (col.gameObject.tag == "Player") { enemyPlayer = col.gameObject; //current player is beaverSprite // enemyInputScript = enemyPlayer.GetComponent<get_input>(); enemyStateScript = enemyPlayer.GetComponent<player_state> (); //only want players of opposite teams if (playerStateScript.GetTeamNumber () != enemyStateScript.GetTeamNumber ()) { //TODO: case for both have dash on if (enemyStateScript.GetIsDashing () == true) { //enemy has dash on //player becomes immobile and drops the pearl in the direction of impact damageScript.Damage (); //knockback the other player (This player) //StartCoroutine(Knockback(beaverSprite, 1f, 350, beaverSprite.transform.position)); } } } } }