ChangeRoom( new_room_name )



This function removes your client from the room it is in to the new room in the argument. This is exactly the same as joining a room so join room / change room can be used interchangeably.

The new room name has to be a string. Please understand that and do not pass any other values. That could severely crash your server and will have to restart. Room names are case sensitive and overall just really sensitive. “home ” is not the same as “home”. Also do not use emojis and other such characters. We 💕 emojis but they complicate code a lot.
The new room name also can’t be a numeric string like “3” , “234” “1010”. This is because all private rooms are going to be numbers right? So we don’t want to join anyone’s private room. There is a workaround however. Instead of room id “67” you can put “ 67”. That extra space allows you to bypass this rule.

What happens after I join this new room?

  1. All instances of other players from your previous room, if there were any are destroyed, and now ones from this room are created.
  2. Now your shared properties are only shared with members of this room.

How do I know I’ve joined the new room successfully?

After a successful connection/joining your server the callback function callback_ChangeRoom() is called. So under Scripts/Rocket Networking/Callback Functions , you can edit this to do whatever you want…

Example Implementation of callback

  • Here I’ve just done a show_message so the user is shown a dialog box with that message but you get the idea