Creating a custom saferoom for all players in the same location.

Hello, I am trying to create a room that all players can enter but when they do they only see their own custom setup. When a player invites others to their team, all players see the leader’s room. When inside your room you can look out and see everyone (world) but players looking in see an empty room. Like 1 room in an appartment but all players share the same room’s location. Can this be done?

Yes it is possible. Spawn all cosmetic props on client-side, according to each client’s customization, and don’t replicate anything. When leader invites others, replicate his customization to them and rebuild it (locally) accordingly.

1 Like

Thank you for the reply. If I make the room like you say and 2 players are both in the room, would they see each other? I want it to be a private area, no one can see in but you can see out. So if in a group they all can see the leader’s custom room and each other but if they are not in a group then they can’t see each other.

Well yes, by default everyone can see everyone (provided they are on the same server), but you can always manually control local characters visibility with your own logic.

This is the main thing I want to create, a room in which you are phase out from the rest of the game. World of warcraft had a town that if someone watched you walking into it you would just disappear. It was a private town, i want to do the same with a room in my game. is this possible?

In case of world of warcraft it was most likely because different parts of the map are handled by different servers, and when you change map you are transferred from one server to another.

If you’re not making an MMO your setup is gonna be much simpler, but regardless, yes you can always control lots of things with code, especially visibility of things. Your game code executes on the server machine and on every connected client machine, and generally you want the server to replicate as much data as possible so every client can be properly synchronized and see the exact same thing. However it is also possible to do the opposite, not replicate and alter visuals on a each client machine so that they each see what you want them to see. This works best for cosmetics, and is much more difficult if collision is involved. However in your case it seems to be cosmetic so it should be fine.

Showing a prop for one player is as simple as spawning it (SpawnActor) on that client’s computer. The engine provides various utilities so you can check “where” your code is currently executing - such as IsDedicatedServer? HasAuthority? IsLocallyControlled?

Hiding and showing another player when he enters/leaves a room can be done using a Volume or a blueprint with an overlap trigger box, and setting that player’s visibility upon overlap enter/leave.

1 Like