Outlawdlaw
Outlawdlaw3mo ago

First player isn't synced to other players, while other players are visible to the first player

No idea why this started happening - didn't change any code from what I can tell, but now whenever a new player joins they can't see the other players in the room. Only the first player to join can see the others
30 Replies
kapa.ai
kapa.ai3mo ago
Hi @Outlawdlaw. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- This issue might be related to how the state of the room and objects are synchronized in NormalVR. According to the documentation (https://normcore.io/documentation/architecture/client#datastore), all state is synchronized using the room's datastore. If you need to move an object in the world, you change its position in the datastore. The datastore will automatically detect any changes and notify all clients connected to the room so they can update their world to match. If a player joins the match late, one of the existing clients would now be responsible for catching up the new client with the state of the room. However, with Normcore’s datastore, there’s no need to manually synchronize clients like this. If you make a change to the datastore, it’s automatically replicated to all connected clients. And when a client joins a room late, the server is able to send them a complete copy of the datastore without requiring any intervention from the other clients. If the issue persists, it might be related to how RPC messages are handled in Normcore. As per the documentation (https://normcore.io/documentation/room/room#rpcs), RPC messages in Normcore are available as a last resort. If you have players that can join a room late, RPC messages make consistent synchronization difficult. Any state modified in response to an RPC message will need to be manually synchronized by your own code. If you're trying to debug ownership settings at runtime, the RealtimeView inspector includes Request Ownership and Clear Ownership buttons that function like calling RequestOwnership() or ClearOwnership() in code as mentioned in the documentation (https://normcore.io/documentation/room/ownership-and-lifetime-flags#at-runtime-with-the-unity-inspector). Please check these aspects in your code and see if they help resolve the issue. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@290458313882337280> kapa.ai is still learning and improving, please let us know how it did by reacting below
Outlawdlaw
Outlawdlaw3mo ago
@Normcore Assistant I'm following the basic getting started tutorial, I haven't used RPCs or done anything to the datastore
kapa.ai
kapa.ai3mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- If you're following the basic getting started tutorial and haven't made any changes to the datastore or used RPCs, then it's possible that the issue might be related to how objects are being synchronized in your scene. In Normcore, the state of objects is synchronized using the room's datastore. When a player joins a room late, the server sends them a complete copy of the datastore, which includes the state of all objects in the room. This is done automatically without requiring any intervention from the other clients (source (https://normcore.io/documentation/architecture/client#datastore)). However, there are some common issues that can prevent objects from being properly synchronized: 1. Object Serialization: Only primitive types (int, float, Vector3, string, etc.) can be serialized. If you're trying to sync a specific kind of object like a TextMesh Pro object, you should create a field for each property on the object that you’d like to sync (source (https://normcore.io/documentation/room/common-questions#when-i-try-to-sync-a-specific-object-to-the-datastore-i-get-an-error-that-says-it-cannot-be-serialized-whats-the-issue)). 2. Object Ownership: This error generally happens when multiple clients attempt to delete the same model from a RealtimeSet at the same time. If you’re not using RealtimeSet directly in your project, this can happen if multiple clients call Realtime.Destroy() on the same object at the same time. In order to prevent this, we generally recommend having the client that owns the object destroy it: if (realtimeView.isOwnedLocally) Realtime.Destroy(gameObject); (source (https://normcore.io/documentation/room/common-questions#im-getting-the-error-server-attempted-to-delete-value-from-set-for-key-that-doesnt-exist-in-storage-this-is-a-bug-how-do-i-fix-this)). If you're still having trouble, it might be helpful to revisit the Getting Started (https://normcore.io/documentation/essentials/getting-started) guide to ensure that all steps were followed correctly. If the issue persists, consider reaching out to the Normcore community on their Discord (https://normcore.io/discord) or forum (https://forum.normcore.io/) for further assistance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@290458313882337280> kapa.ai is still learning and improving, please let us know how it did by reacting below
Mechabit
Mechabit3mo ago
have you got your XR rig in the avatar?
Outlawdlaw
Outlawdlaw3mo ago
I'm not using an XR rig, just a basic hoverbird avatar
Mechabit
Mechabit3mo ago
have you looked in the editor to see where all the players are? usually when this happens it's because all the players are stacked up on the camera
Outlawdlaw
Outlawdlaw3mo ago
On the first player to join / create the room, both players are visible and spawned. On subsequent joiners there's only one player spawned
Mechabit
Mechabit3mo ago
but did you look in the editor from their prespective? you can click on the avatar clones to see their position
Outlawdlaw
Outlawdlaw3mo ago
Yes, that's how I know there's only one clone
Mechabit
Mechabit3mo ago
so no avatars spawn at all?
Outlawdlaw
Outlawdlaw3mo ago
Just the one. They spawn fine for the first player
Mechabit
Mechabit3mo ago
that's never happened before usually you get avatar clones on all clients or not at all otherwise no one would be able to see any positions post a sceenshot of 2 editors from both perspectives
Outlawdlaw
Outlawdlaw3mo ago
Alright