Thread: Sleep/Wait In Unity

  1. #1
    Registered User Inkinsarto's Avatar
    Join Date
    Apr 2013
    Posts
    34

    Sleep/Wait In Unity

    I have been trying to make a sleep function in C# that will allow the game to be briefly paused when played. If it helps any, I am using Unity 3D.

  2. #2
    Registered User Inkinsarto's Avatar
    Join Date
    Apr 2013
    Posts
    34
    Also, I have already tried using System.Threading; And then Thread.Sleep(); But it doesn't seem to do anything.

  3. #3
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    Are you sleeping on a background thread?

    Sleeping a thread is rarely the best solution. I'm not saying it's not the best solution in your case, just that there's usually a better way to do it.

    I've never done anything with Unity 3D but a "pause unity game" google search came up with setting Time.timeScale to 0 or call the OnPauseGame() method. Here's the page I found it on: How do I pause my game? - Unity Answers
    If you understand what you're doing, you're not learning anything.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. UDK and Unity
    By DavidP in forum Game Programming
    Replies: 10
    Last Post: 11-06-2009, 09:23 AM
  2. making my program sleep / wait / delay...
    By bobthebullet990 in forum C++ Programming
    Replies: 4
    Last Post: 08-13-2006, 10:14 AM
  3. sleep and wait
    By axr0284 in forum C++ Programming
    Replies: 5
    Last Post: 01-06-2006, 11:47 AM
  4. unity (further);
    By doubleanti in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 02-26-2002, 03:16 PM
  5. Unity Computers
    By (TNT) in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 11-22-2001, 10:10 PM

Tags for this Thread