hdi200
hdi2004mo ago

Is there a way to see what realtimeView's a specific client owns by Client ID?

Is there a way to see what realtimeView's a specific client owns by Client ID?
4 Replies
kapa.ai
kapa.ai4mo ago
Hi @hdi200. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- There isn't a direct method provided by Normcore to list all RealtimeViews owned by a specific client ID. However, you can check the ownership of a specific RealtimeView or RealtimeComponent by accessing its ownerIDSelf property. This property returns the client ID of the component owner. Here's an example of how you can use it:
int ownerID = myObject.GetComponent<RealtimeView>().ownerIDSelf;
int ownerID = myObject.GetComponent<RealtimeView>().ownerIDSelf;
If you want to check the ownership of all RealtimeViews in your scene, you could potentially iterate over all RealtimeViews and check their ownerIDSelf property. Remember that the ownerIDSelf property might not be reliable before the Start method is called, as mentioned in the documentation (https://normcore.io/documentation/reference/classes/Normal.Realtime.IRealtimeComponent). Please note that this approach might not be efficient if you have a large number of RealtimeViews in your scene. It's generally better to design your application in such a way that you keep track of ownership changes when they happen, rather than checking all objects in every frame. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai4mo ago
<@560113177543835660> kapa.ai is still learning and improving, please let us know how it did by reacting below
hdi200
hdi200OP4mo ago
any other options?
Towellie
Towellie4mo ago
Hey, to reply to the bot you need to @mention it