Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Resolved Is This the Most Suitable Method to Spawn Objects Without Delay on the Client Side?

Discussion in 'Netcode for GameObjects' started by Fujimon8142, Mar 15, 2024.

  1. Fujimon8142

    Fujimon8142

    Joined:
    Sep 28, 2021
    Posts:
    2
    Is the method to instantiate an object on the client side without delay to instantiate it using [Rpc(SendTo.Everyone)]?

    For example: PlayerOnlineFirer.FireTorpedoRpc()
     

    Attached Files:

  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,616
    No, client spawn will always be delayed even for the local player since the Rpc goes to the server first, and then returns with the (internal) command to spawn the object.

    Only exception is the host player which spawns objects instantly because a server RPC called from the host is like a local method call.
     
    Fujimon8142 likes this.
  3. Fujimon8142

    Fujimon8142

    Joined:
    Sep 28, 2021
    Posts:
    2