Can you get a client id directly from realtimetransform?
Can you get a client id directly from realtimetransform?
26 Replies
Hi @cryptomax. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
No, you cannot directly get a client ID from
RealtimeTransform
. However, you can get the client ID from the RealtimeComponent
or RealtimeView
that owns the RealtimeTransform
.
You can use the ownerIDSelf
property of the RealtimeComponent
or RealtimeView
to get the client ID of the component owner. Here's an example of how you might do this:
Please note that accessing these properties before Start
is unreliable.
For more information, you can refer to the RealtimeComponent (https://normcore.io/documentation/reference/classes/Normal.Realtime.RealtimeComponent%601) and RealtimeView (https://normcore.io/documentation/reference/classes/Normal.Realtime.RealtimeView) documentation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@401986039964631060> kapa.ai is still learning and improving, please let us know how it did by reacting below
@Normcore Assistant the view is not usually owned so that would not tell us the client id of the realtime transform owner though
Let me check the knowledge base for you. One moment! :books:
----------------------
You're correct. The
RealtimeTransform
component and the RealtimeView
can have different owners. If you want to get the client ID of the owner of the RealtimeTransform
, you should use the ownerIDSelf
property of the RealtimeTransform
itself, not the RealtimeView
.
Here's how you can do it:
This will give you the client ID of the current owner of the RealtimeTransform
. If the RealtimeTransform
is not owned by any client, ownerIDSelf
will return -1
.
For more information, you can refer to the RealtimeComponent (https://normcore.io/documentation/reference/classes/Normal.Realtime.RealtimeComponent%601) documentation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@401986039964631060> kapa.ai is still learning and improving, please let us know how it did by reacting below
The client ID of the RT owner? Yeah, just
model.ownerIDSelf
I have a terrible memory and forget what properties i can get to from where 😦
yeah fair honestly
But yeah you can just do
rt.ownerIDSelf
additionally isOwnedLocallySelf and isOwnedRemotelySelfisn't intelisense supposed to tell you these things if you just rt.?
Yeah
Does it not show for yours?
well for me it doesn't
Check the properties (wrench icon)
![No description](https://cdn.answeroverflow.com/1227870648546754621/image.png)
I can manually trigger it using crtl space but even then it just shows abc items instead of wrenches, and I dont have the little icones you do there
I'm using VS2022