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
1
Question by akkiDev · Mar 19, 2015 at 12:07 PM · playerbackgroundnew-feature

OnApplicationPause is not working correctly in Unity 5.

I upgraded my project from unity 4.5 to unity 5.0. And i am experiencing the abnormal behavior of OnApplicationPause method of unity. I have the following code.

 void OnApplicationPause (bool pauseStatus)
     {
         if (pauseStatus)
            print ("Application Paused");
         else
            print ("Application Resume");
     }

It never print Application Paused when I switch out from unity editor but it print Application Resume when i switch back to unity editor. this works fine in Unity 4.5.

Comment
Add comment · Show 1
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 ocimum · Sep 02, 2015 at 02:09 PM 0
Share

Have the same problem, did you find a workaround for this problem?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by ocimum · Sep 02, 2015 at 03:16 PM

Looks to me like it could be the fixed issue discovered in version 5.1.xxx

Maybe you upgrade to a higher or stay on Unity 4.5 if you need lower versions because of maintaining your projects.

Comment
Add comment · Show 5 · 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 Andrey-Postelzhuk · Mar 24, 2016 at 08:57 AM 0
Share

Still have this issue in Unity 5.3.4

avatar image Andrey-Postelzhuk · Mar 24, 2016 at 09:07 AM 1
Share

Found a solution for me. It was 'run in background' enabled checkbox. http://answers.unity3d.com/questions/9899/how-do-you-keep-your-game-running-even-when-you-sw.html

avatar image MMOERPG · May 27, 2016 at 11:27 PM 0
Share

<3 you Andrew! what are the chances you supply this data 2 days before I go searching for it! Thanks for posting your solution.

avatar image MMOERPG · May 28, 2016 at 12:01 AM 0
Share

@Andrey Postelzhuk Hmm I tried to implement this for the Iphone with the "Requires Fullscreen" bool unchecked since there is no "run in background" bool. It does not seem to be calling OnApplicationPause function:

 void OnApplicationPause(bool pauseStatus){
     if(pauseStatus){
         SetChallengerStatus (0);
     }
 }
avatar image MMOERPG · May 28, 2016 at 01:20 AM 0
Share

So I got it working on iphone by setting the "Behavior in Background" list to Custom. This option is found in player settings => other settings => configuration.

"Requires Fullscreen" bool must also be set to false.

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

25 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Move player or background 0 Answers

why isn't the video playing from my assets? 0 Answers

For some reason when i start the game my players go out of the camera zone ? or they get invisible ? 0 Answers

Check if player is moving 5 Answers

Unity Web Player backgroundcolor 1 Answer


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