Funkey
Funkey
NNormal
Created by Funkey on 7/29/2024 in #🤝ask-a-question
How to update a element in a realtimeArray for all clients?
I currently have a realtimeArray of a Vect2 within another Sync script. On a fresh model I loop through the number of players I want the array to account for and I Add a new Vect2 Model to it then subscribe the index to the DidChange events I want. The onChange event does fire locally but it doesn't sync the data of the array to other clients. Should I add the realtimeArray of Vect2 to the model of the Sync script that holds it? I know that I'm subscribing to the event and that the DidChange event fires locally but it never syncs the array to other players. How do I ensure that the synced data goes to every client?
19 replies
NNormal
Created by Funkey on 7/11/2024 in #🤝ask-a-question
Difference between avatar.ownerIDInHierarchy, avatar.ownerIDSelf, and avatar.realtime.clientID?
I'm trying to keep track of the ID of the current client as clients leave and enter the room. I'm finding that avatar.owner.IDSelf always returns -1. avatar.ownerIDInHierachy seems to work but if someone leaves, and rejoins they get assigned to ID 0 even though the former client that had the ID of 1 also gets set to the ID of 0. This causes errors with my system that isn't expecting two clients to both have the ID of 0. avatar.realtime.clientID seems to work but never reassigns the ID's when someone leaves. For example if a room has two clients and client 0 leaves. Client 1 remains as ID 1 but once the client that left, rejoins the game. Their ID gets set to 0. Which ID system should I use for a system that expects unique ID's for each client and can handle clients leaving and joining without assigning duplicate ID's?
30 replies
NNormal
Created by Funkey on 3/25/2024 in #💭feature-request
Clear a RealtimeArray
I understand that we can't have a remove for a RealtimeArray to avoid race conditions, but clearing the entire array is a very useful operation for this powerful structure! Clearing it would make the structure even better! Let's clean data! 🧹
10 replies