Slow Mo effect with Time.timeScale? Dont understand Lerp and Corutines...

I allready have a working code to achieve a slow mo effect… It falls down and then up- but, I think it can be made way cooler by someone who understands coroutines and lerp properly (this person is not me);

How could I implement an effect similar to this one by using Lerp or Slerp? thank you for the help :slight_smile:

public class TimeManipulation : MonoBehaviour {

	KeyCode timeManipualtionKey;
	public bool manipulatingTime;
	public bool manipulatingDown;
	public bool manipulatingUp;
	public float manipulationRate;
	public float timeManipulationDown = .5f;
	public float lerpSpeed = 10;
	public float durationOfManipulation = 2;

	float it = 1;
	float increment = .05f;

	void OnEnable()
	{
		timeManipualtionKey = this.GetComponent<Attributes> ().timeManipulation;
	}

	// Update is called once per frame
	void FixedUpdate () {

		if (Input.GetKeyDown (timeManipualtionKey)) {
			manipulatingTime = true;
			manipulatingDown = true;
		}

		if (manipulatingTime) {
			if (manipulatingDown) {
				if (it >= .5f) {
					print ("manipulating Down");
					it -= increment;
					Time.timeScale = it;
					Time.fixedDeltaTime = 0.02f* Time.timeScale;
				} else {
					print ("finished manipulation Down");
					manipulatingDown = false;
					StartCoroutine (TimeInTheZone ());
				}
			}

			if (manipulatingUp) {

				if (it <= 1) {
					print ("starting manipulating up");
					it += increment;
					Time.timeScale = it;
					Time.fixedDeltaTime = 0.02f * Time.timeScale;

				} else {
					print ("manipulation ended");
					manipulatingUp = false;
					manipulatingTime = false;
				}
			}
		}
	}

	IEnumerator TimeInTheZone()
	{
		print ("starting wait");
		yield return new WaitForSeconds (1);
		print ("wait ended");
		manipulatingUp = true;
		yield return null;

	}
}

Unity’s scripting reference does an awful job of explaining Lerping. Here’s a guide I found that does a better job of explaining it.

Even though it’s a guide on Vector3.Lerp, Mathf.Lerp is basically the same concept.