private void FixedUpdate() { if (!jumping) { if (idleShooting) { rigid.SetVelocity(0f, 0f); } else { if (pDetect.detected) { efd.SetOnGroundVelocity(horizontalVelocity * 1.2f); } else { efd.SetOnGroundVelocity(speed); } } } else { rigid.AddForce(new Vector2(horizontalSpeed * efd.dir, jumpForce * ascend)); } }
private void FixedUpdate() { if (!detected && !prepared) { efd.SetOnGroundVelocity(currentSpeed); } else if (detected && !prepared) { rigid.velocity = new Vector2(0f, rigid.velocity.y); } else if (prepared) { efd.SetOnGroundVelocity(currentSpeed * 1.5f); } }
private void FixedUpdate() { if (!attacking) { efd.SetOnGroundVelocity(speed); } else { rigid.SetVelocity(0f, 0f); } }
private void FixedUpdate() { if (efd.OnGround) { efd.SetOnGroundVelocity(currentSpeed); } else { rigid.SetVelocity(0, 0); } }
void FixedUpdate() { efd.SetOnGroundVelocity(currentSpeed); }