Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

On time slow down only player enable to move

$
0
0
hi, i am using to Time.timeScale for slowing down time by pressing "t". I am getting everything slowed down including the player. Is there anyway to slow down everything except the player. here is my script, i have still some works to do, like adding a coroutine for making the time slow down temporary. var slowammount: float = 0.2; var visible; var skin:GUISkin; var slowtex : Texture; function Start() { Time.timeScale = 1; visible = false; } function OnGUI() { if (skin != null) { GUI.skin = skin; } if(visible == true){ if(Time.timeScale == slowammount) { GUI.DrawTexture(new Rect(0,0,Screen.width, Screen.height), slowtex); } } } function Update () { if (Time.timeScale == 1) { if (visible == false){ if (Input.GetKeyDown("t")) { visible = true; Time.timeScale = slowammount; } } } }

Viewing all articles
Browse latest Browse all 171066

Trending Articles



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