Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by SilentWarrior · Feb 09, 2013 at 10:26 PM · coroutines

Coroutines stop when another game goes fullscreen

Hello, I have built a quite complex application using unity, its not a game, but a full blown application that needs the 3D features of unity.

One of the features is sending messages to a gameserver of another game.

When I am on windows (any app) or looking at the unity itself, everything runs smoothly, however, if I tab into the game (that runs fullscreen), it stops sending messages after about 1 or 2 seconds.

What could cause this? I have "run in background" setting activated.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by ThePunisher · Feb 09, 2013 at 10:48 PM

What do you mean it stops sending messages? What kind? Does it start sending messages again if you tab back to the application? Where/When do you send these messages?

My suggestion would be that you try sending your messages in an Update loop instead of a coroutine. Not sure why you made it a coroutine. If it's some sort of heartbeat or information update that happens from the start of the application to the end then it's worth putting it on an Update loop.

Comment
Add comment · Show 13 · 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 SilentWarrior · Feb 10, 2013 at 12:50 AM 0
Share

$$anonymous$$y problem is that it acts like if the "run in background" option is disabled, but it isnt.

avatar image ThePunisher · Feb 10, 2013 at 03:23 AM 0
Share

You're not giving me enough information at all... You need to answer some of the questions I asked you for me to be able to help.

avatar image SilentWarrior · Feb 10, 2013 at 02:32 PM 0
Share

I am sending messages to a gameserver via sockets. I am also displaying them on screen inside unity. I have it sending framecounts so I know if unity is running. It will send for example a message saying 400 framecounts, and then i go ingame (other game in fullscreen), it stops sending, i stay 30 $$anonymous$$utes in the other game and exit out, and unity resumes from the 400th frame, meaning, it stopped completely.

This happens in coroutines aswell as Update(), I have "run in background" set to true in both code and project settings.

Its made in coroutines because of the easier wait for seconds, but I have also tried in Update() with delays using Time.time - lastUpdate > timeout for example.

avatar image ThePunisher · Feb 10, 2013 at 08:07 PM 0
Share

The D3Device is lost when you $$anonymous$$imize the unity window to go to something else, meaning it's not rendering. If you have some sort of logic based on that it would explain why you stop getting the updates.

Go take a look at your Unity log (output_log) under your GameExeName_data folder and you will be able to see nothing but a repeated message saying "D3Device was lost, trying to recover", etc. Hope that helps.

avatar image SilentWarrior · Feb 10, 2013 at 08:24 PM 0
Share

Would that explain why coroutines also stop running?

Show more comments

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

11 People are following this question.

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

Related Questions

Coroutines vs Update/FixedUpdate/LateUpdate 2 Answers

How to Invoke() .. one frame 2 Answers

Waiting for Input via Coroutine 2 Answers

If I StopCoroutine("myCoroutine")', will the variable values in myCoroutine be reset? 1 Answer

Flash image while ammo is low - coroutines? 3 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