void checkForDamage() { if (collisions[(int)CollisionsLoc.botColl] == TAGS.GROUND && collisions[(int)CollisionsLoc.topColl] == TAGS.PLAYER) //if on the ground and opponent is on top { //Start damage anim StartCoroutine(cubeSpitter.spawnCubes()); transform.localScale = new Vector3(transform.localScale.x, transform.localScale.y - 0.5f / maxHealth, transform.localScale.z); //==Add screenshot code here==// if (transform.localScale.y < 0.2 && transform.localScale.y > (0.2 - 0.5 / maxHealth)) { gcs.captureScreen(playerNum); Debug.Log("Capturing Screen"); } if (transform.localScale.y < deathSize) { die(); } } }