Sleep/Wait In Unity

This is a discussion on Sleep/Wait In Unity within the C# Programming forums, part of the General Programming Boards category; I have been trying to make a sleep function in C# that will allow the game to be briefly paused ...

  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,164
    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, 08: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, 10:47 AM
  4. unity (further);
    By doubleanti in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 02-26-2002, 02:16 PM
  5. Unity Computers
    By (TNT) in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 11-22-2001, 09:10 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21