Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Run in Background doesn't Work Properly in Embedded Applications

Discussion in 'Web' started by yusuf_unity310, Apr 3, 2024.

  1. yusuf_unity310

    yusuf_unity310

    Joined:
    Aug 4, 2023
    Posts:
    2
    I'm making a build with the "run in background" property disabled. When I upload that build to the Netlify to test it, it works as intended. Game musics stop when I minimize the browser. But if I upload the same build to the embedded android application, it doesn't stop when I minimize the app. I think in embedded application, you need to do few extra steps to let your Unity game receive application minimized events.
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,467
    yusuf_unity310 likes this.
  3. yusuf_unity310

    yusuf_unity310

    Joined:
    Aug 4, 2023
    Posts:
    2
    I have tested the Unity Webgl app on Android and it seems this property works! It doesn't play sound when I minimize the app if this property is disabled. So from what I understand, I need to somehow get app minimized message from Android's WebView and redirect it to my Unity app, and within my Unity app I need to somehow stop the game.