Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
7
Question by dr.light · Oct 04, 2011 at 09:00 PM · renderingosxgame window

How to keep Unity rendering when focus is not set to game window

Im using UDP to control the unity environment. Ive written a test app to send data into unity that consists of a dozen buttons, faders, and some XY pads. When i set OSX's focus to my test app (read: select the test app as the active application in the title bar), unity stops re-drawing the game. Essentially i either need to run the app on a second machine, which is a PITA when i am just knocking things around on my laptop (95% of my dev cycle) - or write automated code inside my test app which simulates human interaction with the app (which i have done already).

Does anyone have a solution for getting Unity to keep drawing, even when focus is not set to it within the OS?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
17
Best Answer

Answer by asafsitner · Oct 04, 2011 at 09:02 PM

Put Application.runInBackground = true; somewhere in your code and you should be good to go.

See the documentation: http://unity3d.com/support/documentation/ScriptReference/Application-runInBackground.html

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bunny83 · Oct 04, 2011 at 09:09 PM 3
Share

You can also set this somewhere in the project settings but i also prefer setting it via script ;)

 Edit-->Project Settings-->Player-->Resolution and Presentation-->Run In Backgound
avatar image asafsitner · Oct 04, 2011 at 09:11 PM 0
Share

Right. I always forget about that one... which is why I always set it via script. :)

avatar image ruudvangaal · May 17, 2018 at 04:23 PM 0
Share

Actually, I can still get it (this is Unity 5.4.5f1). It happens when I have an OpenGL rendering window active as well as the Unity player. When activing my own OpenGL window (Unity still running in the background), after 5 seconds or so the Unity window stops rendering. When I use my keyboard, it stays paused. When I move my mouse, it becomes active again for 5 seconds. When I $$anonymous$$imize my own OpenGL window, Unity keeps rendering. Would be good to even continue rendering even when I'm active myself in another window.

avatar image
3

Answer by KevinCook · Apr 14, 2015 at 05:27 PM

No need to add code. There's a tickbox in the player settings.

Go to Edit->Project Settings->Player, select the 'Standalone' tab, and 'Resolution & Presentation'. Now check the 'Run In Background' tickbox.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by dr.light · Oct 05, 2011 at 09:54 PM

thanks guys - you just made me a happy man today.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Timurov · Feb 01, 2013 at 03:25 PM

many thanks guys! I've been looking that so many times :)

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Dave-Carlile · Feb 01, 2013 at 03:48 PM 0
Share

This should be added in the comment area by using the "add new comment" link, not in the area reserved for answers.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity's game window isn't redrawing properly. 1 Answer

Polygon flicker glitch on specific mobile devices 0 Answers

Layer Dependent Reflections 1 Answer

Object not render after build,Object not render after build android 0 Answers

Shadows passes through Custom render pipeline 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges