// Update is called once per frame void Update() { // if the player is currently attacking if (attack == true) { // rotate the hammer down rotatingPoint.transform.localEulerAngles = new Vector3(rotatingPoint.transform.localRotation.x, 90, Mathf.Lerp(rotatingPoint.transform.localEulerAngles.z, maxRotation, Time.deltaTime * smooth)); // check if the image is currently being projected if (!projection.Projecting) { // place a projection projection.Project(transform.position + (transform.rotation * projectPos), Quaternion.Inverse(transform.rotation) * projectRot); projection.Projecting = true; } // if hammer has reached max rotation (down) stop rotation going down if (rotatingPoint.transform.localEulerAngles.z >= maxRotation - 1) { attack = false; } } else // if player is no longer attacking (or hammer is completly down) { // check if a projection is happening if (projection.Projecting) { // stop that projection projection.Projecting = false; projection.fade(fadeTime); // creates a duplicate that fades in time } //rotate to top rotatingPoint.transform.localEulerAngles = new Vector3(rotatingPoint.transform.localRotation.x, 90, Mathf.Lerp(rotatingPoint.transform.localEulerAngles.z, normal, Time.deltaTime * smooth)); } }