void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.tag == "kill") { theGameManager.RestartGame(); moveSpeed = moveSpeedStore; speedMilestoneCount = speedMilestoneCountStore; speedIncreaseMilestone = speedIncreaseMilestoneStore; deathSound.Play(); } }
void OnCollisionEnter2D(Collision2D other) //kun boxcolliderit kohtaa { if (other.gameObject.tag == "killbox") { theGameManager.RestartGame(); moveSpeed = moveSpeedStore; speedMilestoneCount = speedMilestoneCountStore; speedIncreaseMilestone = speedIncreaseMilestoneStore; } Debug.Log("collision"); }
void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.tag == "killbox") { theGameManager.RestartGame(); speed = moveSpeedStore; speedMilestoneCount = speedMilestoneCountStore; speedIncreaseMilestone = speedIncreaseMilestoneStore; } grounded = true; canJump = true; canDoubleJump = false; Debug.Log("collision"); }