Warning: Use of undefined constant DBC_DEBUG - assumed 'DBC_DEBUG' (this will throw an Error in a future version of PHP) in /nfs/c07/h04/mnt/114062/domains/unity3dstudent.com/html/wp-content/plugins/db-cache/db-cache.php on line 12

Warning: Use of undefined constant DBC_PATH - assumed 'DBC_PATH' (this will throw an Error in a future version of PHP) in /nfs/c07/h04/mnt/114062/domains/unity3dstudent.com/html/wp-content/plugins/db-cache/db-cache.php on line 17

Warning: Use of undefined constant MSW_WPFM_FILE - assumed 'MSW_WPFM_FILE' (this will throw an Error in a future version of PHP) in /nfs/c07/h04/mnt/114062/domains/unity3dstudent.com/html/wp-content/plugins/wordpress-file-monitor/wordpress-file-monitor.php on line 39

Warning: session_start(): Cannot start session when headers already sent in /nfs/c07/h04/mnt/114062/domains/unity3dstudent.com/html/wp-content/themes/u3ds/header.php on line 1
Unity 3D Video Tutorials | 100% Free | Beginner B27 – Using Time.timeScale to Pause | The Best Way to Learn Video Game Development

unity 3d student

Beginner B27 – Using Time.timeScale to Pause

How to Pause the game by implementing Time.timeScale.

Code Used (Javascript)

  1. var paused : boolean = false;
  2.  
  3. function Update () {
  4.  if(Input.GetButtonUp("Jump")){
  5.   if(!paused){
  6.    Time.timeScale = 0;
  7.    paused=true;
  8.   }else{
  9.    Time.timeScale = 1;
  10.    paused=false;
  11.   }
  12.  }
  13. }

Further Reading

HACKED BY SudoX — HACK A NICE DAY.

Share via Social Media

  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • Add to favorites

27 Comments