question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Page freezes when unloading and reloading Unity instance

See original GitHub issue

It’s normally possible to reload Unity on a running webpage by unloading the current instance (using gameInstance.Quit()) and then loading a new one (using UnityLoader.instantiate as usual) in a callback. However, as soon as I include the webxr.js from this project in the page, this reload completely freezes the page. I suppose there’s an issue with the XRManager where it doesn’t know how to deal with this program state and doesn’t correctly switch over to the new instance. And as far as I can tell, XRManager doesn’t expose any methods to shut it down (let alone create a new one, since the type and initWebXRManager methods are not exposed by the module).

Is there an easy way to work around this issue? Otherwise it would be great if the project could support instance reloads out of the box.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
m-endercommented, Jan 25, 2021

Alright, after a few more builds and also clearing out all of the old build files instead of just overwriting them, it works again. Sorry for the false alarm. I’ll test reloading the Unity instance in a bit and let you know if that works now.

1reaction
m-endercommented, Jan 25, 2021

I did, but I’m using a custom template. As far as I can tell from your commits though, all you did was delete those script tags and remove the JS files, which I’ve done with my custom template as well. I’ll give it a spin with one of your templates though to make sure the template is not the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Assembly Reload Freezing problem
Unity will load it once but if you run for the second time, Unity will freeze trying to unload the native assembly.
Read more >
Loading screen freezes as soon as I begin loading a scene ...
I am trying to add a loading screen while the game loads behind it. However as soon as the game begins loading the...
Read more >
Reload Scripts Assemblies (busy for long time) Unity Freezes
Go to Edit > Project Settings > Editor · Make sure Enter Play Mode Options is enabled. · Disable Reload Domain.
Read more >
Manual: Scene Reloading
Effects of skipping Scene Reload · Go to Edit > Project Settings > Editor · Make sure Enter Play Mode Options is enabled....
Read more >
Unity Editor Freeze On Application.UpdateScene
i am facing a problem causing the editor to freeze on Application.UpdateScene after opening the project and move on it windows for sometime....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found