Skip to main content
New Participant
December 22, 2020

Rooms.CreateAndJoinPrivate2 returning NULL

Hello everyone

I start off by saying that I'm new to coding in Unity and for Quest and I find the official documentation hard to navigate but I welcome if you could point me to the answer assuming it's there.

I'm trying something very simple, to create a private room with the Platform.Rooms library.
Oculus.Platform.Request room = Rooms.CreateAndJoinPrivate2((RoomJoinPolicy)1, 2, null);

This simple line I got returns NULL and I have no idea why
Anyone can give me some insight on this?

Thank you!

1 reply

Inspiring
April 27, 2021

take a look at what CreateAndJoinPrivate2 returns. It's not a simple "Request" object. It's a Request<Room> object. There is also no point in caching that result. You need to add a callback to it, so you can do something like Rooms.CreateAndJoinPrivate2(RoomJoinPolicy.FriendsOfOwner, 2, options).OnComplete(JoinRoomCallback);