Skip to content

Instantly share code, notes, and snippets.

@vjgrayman
Last active June 17, 2019 21:09
Show Gist options
  • Save vjgrayman/16e60e7bbbb574a162df24674db58663 to your computer and use it in GitHub Desktop.
Save vjgrayman/16e60e7bbbb574a162df24674db58663 to your computer and use it in GitHub Desktop.
make Pause with Time.timeScale to Camera #CSharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Pause : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if(Input.GetKeyDown(KeyCode.Space))
{
Time.timeScale = 0;
// Time.timeScale = 0.25f; <-- make slomo
}
if (Input.GetKeyDown(KeyCode.R))
{
Time.timeScale = 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment