Skip to content

Instantly share code, notes, and snippets.

@DevEarley
Created November 14, 2014 22:00
Show Gist options
  • Save DevEarley/79ae3c98431ea5670042 to your computer and use it in GitHub Desktop.
Save DevEarley/79ae3c98431ea5670042 to your computer and use it in GitHub Desktop.
SlowTimeOnClick
using UnityEngine;
using System.Collections;
public class SlowTimeOnClick : MonoBehaviour {
void Update() {
if (Input.GetButtonDown("Fire1")) {
if (Time.timeScale == 1.0F)
Time.timeScale = 0.7F;
else
Time.timeScale = 1.0F;
Time.fixedDeltaTime = 0.02F * Time.timeScale;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment