// Update is called once per frame void Update() { if (!isLocalPlayer) { return; } if (jumpInput() && !jumping && !ducking) { dY = jumpVelocity; jumping = true; } if (duckStartInput() && !jumping && !ducking) { transform.position = new Vector3(transform.position.x, transform.position.y - .25f, transform.position.z); ducking = true; } if (duckStopInput() && !jumping && ducking) { transform.position = new Vector3(transform.position.x, transform.position.y + .25f, transform.position.z); ducking = false; } if (jumping) { if (transform.position.y > yStart) { dY -= jumpVelocity / decelerationRatio; } else if (transform.position.y < yStart) { dY = 0f; transform.position = new Vector3(transform.position.x, yStart, transform.position.z); jumping = false; } } transform.Translate(new Vector3(0f, dY)); if (fireballInput() && manaCount >= 4) { sc.castFireball(); manaCount -= 4; } //Adds Mana Timer += Time.deltaTime; if (Timer >= 3.0 && manaCount < 10) { manaCount++; Timer = 0.0f; } manaText.text = manaCount.ToString(); }