rogan2528
NNormal
•Created by rogan2528 on 5/8/2025 in #🤝ask-a-question
When is it safe to retrieve the AudioSource from a peer?
I need a reference to the AudioSource (the one that is created by the RealtimeAvatarVoice component). I was retrieving it on an onchange for one of the properties of my model, but it seems like it still doesn't exist by then. Is there an event for when it's created, or should I poll for it?
38 replies
NNormal
•Created by rogan2528 on 5/6/2025 in #🤝ask-a-question
isOwnedLocallySelf seems to be incorrect for me
Sorry, I'm a newbie. I'm instantiating my prefab with:
Realtime.InstantiateOptions options = new Realtime.InstantiateOptions();
options.destroyWhenLastClientLeaves = true;
options.destroyWhenOwnerLeaves = true;
options.ownedByClient = true;
options.preventOwnershipTakeover = true;
GameObject myPeerGO = Realtime.Instantiate("peer", options);
RealtimeView realtimeView = myPeerGO.GetComponent<RealtimeView>();
realtimeView.RequestOwnershipOfSelfAndChildren();
However, on a change callback, on a property of that RealtimeComponent when I query: this.isOwnedLocallySelf, it returns as false. I'm not sure why it would be false. (And the remote ones are returning as true).
21 replies