In my multiplayer project, I use two separate player prefabs: one for PC and one for VR. In the PC scene, I assign the PC prefab in the inspector. In the VR scene, I assign the VR prefab. The issue is that each scene only shows the player prefab that was assigned in that specific scene. So if a PC player joins the PC scene, they see the correct PC prefab. But if a VR player joins from a VR scene, the PC player doesn’t see the VR player correctly, and vice versa.
I suggest Coherence add a feature that allows player prefabs to sync across scenes. This would make sure that even if different scenes use different prefabs, all players can see each other correctly, no matter which scene or platform they’re on. It would help avoid mismatches and make cross-platform multiplayer more consistent. This would make it alot easier.
Hey, I’m not quite sure I follow. When you change scenes you bring across any entities you have authority over. And you have full control over which prefabs you instantiate on the network. See:
In my multiplayer project, I support both PC and VR players, and each scene uses a different player prefab.
In the PC scene, I assign the PC player prefab in the inspector.
In the VR scene, I assign the VR player prefab in the inspector.
The issue is: when players from different scene join the same multiplayer session, they can’t see each other correctly.
A PC player joining from the PC scene sees their own prefab just fine, but doesn’t see the VR player properly.
A VR player joining from the VR scene sees their own prefab, but not the PC player correctly.
This happens because each scene only knows about the prefab assigned locally in that scene. So there’s a mismatch in how players are represented across scenes.
What I’m suggesting is that Coherence adds a feature to sync player prefabs across scenes. That way:
Each player can spawn their correct prefab based on their scene.
Other players regardless of which scene they’re on can still see them properly.
This would make cross-platform multiplayer much smoother and avoid prefab mismatches. It would also simplify development, since I wouldn’t need to manually handle prefab registration or syncing logic across scenes. That what makes VR players see only their on prefab on others and PC players see only their on prefab on others.
So, I think we need further clarification. Questions:
where are you assigning the player prefabs? In the bridge for client connections?
is the intention that you see something like a full body character for PC players and something else for VR players so each player can see what the other looks like?
can you post pictures of the setup in question 1, and could you post what your hierarchy looks like? Like, are you loading multiple additive scenes?
Generally what scene the entity is in doesn’t matter unless you’re using the coherence Scene Management stuff and telling the network what scene an entity is in. For 90% of setups you don’t need this.
There is an object called coherence bridge and there are 2 scenes. One is the pc scene and on is the vr scene. And both scenes have the coherence bridge gameobject. And in the coherence bridge i can select what should be the player prefab and as i said there are 2 scenes and both have the coherence bridge object so in the pc scene i select the PC player prefab to be the player and in the vr scene i set the VR player prefab to be the player so there are 2 prefabs not one each scene has an different prefab. But the issue is that lets say im in the pc scene which has the pc prefab set so i make a server and then an player from the vr scene joins which has an different prefab from the pc one but the player that is in VR looks like an pc player locally because the pc player is in a pc scene which has an pc prefab so it would assume that every player has the pc prefab because it loads only the prefab from the scene and for vr scene since the vr prefab is set to be as player prefab in coherence bridge it would assume everyone has the vr prefab locally. And i want you to guys add that if i set the player prefab in pc scene and a different prefab in VR scene it would show the correct prefab because there are 2 different coherence bridges in each scene that have a different prefab but it can only load the one prefab thats set in the scene locally if you guys still dont understand i will post images.
ok, so I think I understand what you’re doing. Some pictures would help but I suspect what you want is for PC players to see everyone as a PC type and VR players see everyone as a VR type like this:
I want the opposite of what you said i want that vr players can see pc players and not that vr players can only see their own prefab on others and same for pc they can see their same prefab on others but i dont want that i want the opposite of what you said i want pc/vr type to see vr/pc both type depending on what scene they are. This is what i want the image shows. (I want it like PC sees VR as VR and PC as PC) (i do not want PC sees VR as PC and VR sees PC as VR)
aha, yes, that is exactly what I needed to see. So, here’s what’s happening: the client connection prefab is not related to a scene, it’s related to the network connection. Think of the bridge as the bridge between the network and Unity. So, all clients that connect to the network that your bridge is connected to will create one of these connections and instantiate the prefab there according to the settings on their bridge.
What you’re asking for: use the scene on one client to define how another client sees the client connection prefab. This won’t work the way you expect because the network doesn’t really know anything about the Unity scene the way you’d like it to. There is the concept of “scene” in coherence but it’s really just a way of sorting entities into numbered (scene index) groups for the purposes of filtering.
Here’s what I suggest you change:
Don’t use the coherence client connection to instantiate the player avatar (Infiltrator). The CoherenceClientConnection is very flexible and some games do use it for the avatar but don’t think it’s the right choice for you.
Do instantiate the avatar in the scene manually. All you have to do is have something in the PC scene or the VR scene instantiate the appropriate Infiltrator and it will automatically replicate that exact instance to all clients and you’ll get exactly what you want.
Thank you. You guys have no idea how much this means to me i tried for months to make this work but could not and even had to shutdown servers for the game because of it. Please contact me when this feature is added.