Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Freeze game using timer from start, then resume play when click the button. It is possible ?

$
0
0
Hello everyone. I'm trying to make the game freeze from start using time. Show the information for player to read then player can click button "Ok" to start the game. But game still freeze after button "Ok" is pressed. Thanks for anyone who help me. Here is my code. using UnityEngine; using System.Collections; public class MissionPause : MonoBehaviour { public Canvas missionCanvas; bool missionPanel = true; public float Timer = 3f; void Start () { Timer = Time.time + Timer; } void Update () { if (Timer < Time.time) { Time.timeScale = 0; } } public void ResumeGame() { if (missionPanel == true) { missionPanel = false; missionCanvas.enabled = false; Time.timeScale = 1 ; } } }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>