Timing of authority being granted on player prefabs from Realtime Avatar manager
if I spawn in a player prefab using the realtime avatar manager, what is the timing of them being granted authority over the prefab, is it after it has been spawned? generally I also want to know the timing and time taken to grant authority.
3 Replies
Hi @RonJames. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
When you use the RealtimeAvatarManager to spawn a player prefab, authority (ownership) over the prefab is granted to the local client at the moment the prefab is instantiated. The prefab is instantiated with the local client as the owner, and this ownership is set immediately as part of the instantiation process. This is handled internally by Normcore, and the ownership is effective as soon as the prefab appears in the scene.
Specifically, when the RealtimeAvatarManager instantiates the avatar prefab for the local player, it ensures that the RealtimeView on the root of the prefab is owned by the local client. This is equivalent to calling
- Authority is granted at the moment of instantiation, not after.
- By the time
- There is no significant delay; the process is immediate from the local client’s perspective. If you need to perform logic that depends on ownership, you can safely do so in
Realtime.Instantiate()
with ownedByClient: true
, which grants ownership at the time of instantiation—not after. On remote clients, the prefab will also appear with the correct owner set from the start. The process is atomic from the perspective of the local client: the prefab is created and ownership is assigned in a single step, so you can safely assume that by the time your scripts' Start()
methods run on the prefab, the local client is already the owner of the RealtimeView and its components. There is no additional delay or handshake required for authority to be granted after instantiation; it is immediate and synchronous with the instantiation event on the local client, and synchronized to other clients as part of the network update cycle Requesting ownership of a RealtimeView Avatars.
In summary:- Authority is granted at the moment of instantiation, not after.
- By the time
Start()
runs on the prefab, the local client is the owner.- There is no significant delay; the process is immediate from the local client’s perspective. If you need to perform logic that depends on ownership, you can safely do so in
Start()
or in response to the avatar being created by the RealtimeAvatarManager.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@378869779668140042> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
it’s instant. it all goes out in the same packet and is applied at creation time for all clients who receive the instantiate call from the server