Cannot Connect to my Atlas cluster in Unity

How can I connect to the Atlas cluster Database using Realm in Unity?

I have referenced the youtube tutorial but it does not work!

https://www.youtube.com/watch?v=aIU20Cufd-o&ab_channel=MongoDB

I always got an error at “_realm = await Realm.GetInstanceAsync(new PartitionSyncConfiguration(“test@test.com”, _realmUser));” (See it in Screen Capture)
I have tried it for a week, but it still does not work!!!

Hi @Yin_Ar and welcome to the MongoDB Community forums.

I haven’t worked with Unity before, but I wonder if things have changed in the past year since that video was recorded.

I did see that there is a section for Unity over at the MongoDB Developers site.

I wonder if that might have some helpful tutorials and posts for you.

@Yin_Ar You may want to move over to forums.realm.io for this question - there is support for building a Unity app, with our Realm .NET SDK, and using Atlas Device Sync to sync to Atlas. There are some docs here -
https://www.mongodb.com/docs/realm/sdk/dotnet/unity/

But the error you are seeing is that you are trying to connect with a partition-based sync API from the client but your server-side Atlas App Services is configured with Flexible Sync - you’ll want to change it on one side or the other but I’d recommend Flexible Sync as that is the future of Device Sync at MongoDB.

1 Like