WebGL RegionRequest timeout

Hiya,

So I have a setup where I am instantiating a prefab with Coherence bridge then doing calls to get the Region to create rooms. This works well when I run in editor but once I build it out and run the webgl build locally it just times out. I’m not quite sure how to debug this. Thanks!

Hello, do you have a build you can share that we can inspect, or can you post any errors you see in the console logs? You can post your build to a page on coherence: Share Builds - Unity Multiplayer SDK Documentation | coherence

Okay I’m seeing the errors with a test project I made:

Here is a link to the build: Test project - coherence

Is there a specific host or someplace I can put up this little sample project I made?

I think I figured out the issue after looking through the example code. I was missing the coroutine that waits on the cloud service to fully login. I don’t think I saw that flow in the documentation anywhere.

Hey @michael.picerno, thanks for mentioning that about our documentation. We’ll take a look and see if we can tweak that bit.

Ah, thanks for updating us. So to clarify, you were able to do something like this?

await cloudService.WaitForCloudServiceLoginAsync(1000); and that solved your problem?

Since the project I’m making is for webgl I had to use a coroutine so I copied this part:

StartCoroutine(WaitForCloudService());

private IEnumerator WaitForCloudService()
{
    while (!_coherenceCloudService.Rooms.IsLoggedIn)
    {
        yield return null;
    }

    _coherenceCloudService.Rooms.RefreshRegions(RefreshRegions);
} 
1 Like