Hi,
I’m trying to join a Photon room using a specific roomID
, but it’s not working as expected. I’ve attached an image of my code for reference.
The CreateRoom
and JoinRandomRoom
methods work perfectly, but when I try to use JoinRoom
with a specific roomID
, the client fails to connect.
Could someone please help me implement the correct approach to join a room by ID in Photon using PlayCanvas?
Thanks in advance!

Hi @Pasindu_Vishmitha and welcome!
From what I can see in your code, it doesn’t look like you’re using the roomId
variable to actually connect to a specific room.
Are you sure you’re passing it correctly when attempting to join or reference a room?
Hi @Albertos, thank you for the quick response!
Yes, I tested both Option 1 and Option 2, but unfortunately neither of them worked.
I’ve attached the code I used in my earlier implementation, along with the error message I received.
Would really appreciate it if you could take a look and help me figure out what’s going wrong.
Thanks again!

Looking at the documentation I don’t see anything wrong.
https://doc-api.photonengine.com/en/javascript/current/Photon.LoadBalancing.LoadBalancingClient.html
joinRoom(roomName, optionsopt, createOptionsopt) → {boolean}
Joins a room by name and sets this player’s properties.
How do you create the room?
Yes, I’ve been implementing everything based on the documentation you linked.
Room creation works perfectly, and joinRandomRoom
also works as expected.
The only issue is with joining a room using the room ID. I even tried using roomName
instead of the ID, but I still get the same error:
“joinRoom is not a function.”
I’ve attached both the room creation and join code snippets for reference.
Maybe you could check whether the room is being created correctly, just to make sure that’s not where the problem is.
availableRooms() → {Array.<Photon.LoadBalancing.RoomInfo>}
Current room list from Master server.
Hi @Albertos,
The error actually wasn’t related to the room creation. it turned out to be due to some customizations made in the LoadBalancing script. I’ve fixed that now, and the joinRoom
functionality is working perfectly!
Thank you so much for your help and guidance. I really appreciate it!
1 Like
Glad you got it sorted out! 
Best of luck with your project! 
1 Like