Hi all I’m having trouble with using Time.timeScale… not sure if im using it incorrectly… but im trying to get my game to run at half speed if the collision is detected… i also tried running it in update… but neither works
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class WinningScript : MonoBehaviour {
private bool Truth = false;
public GameObject Win;
void Start ()
{
Win.GetComponent<Renderer>().enabled = false;
}
void OnTriggerEnter2D (Collider2D coll)
{
if (coll.gameObject.tag == "Player")
{
Truth = true;
Time.timeScale = .5f;
}
}
void Update ()
{
if (Truth == true)
{
Time.timeScale = .5f;
Win.GetComponent<Renderer>().enabled = true;
}
}
}