Search Unity

UNET HLAPI How to parent spawned object to something and keep it buffered?

Discussion in 'UNet' started by Artaani, Mar 20, 2018.

  1. Artaani

    Artaani

    Joined:
    Aug 5, 2012
    Posts:
    423
    So I want to spawn an object and attach it to another object (set parent)
    And client who will join the game some time later, should have this object parented to correct object.
    How to achieve that?

    If we will use RPC in order to parent object manually after instantiation - new clients will not have this information because RPC is not buffered in UNET.

    The only possible solutions which I found was based on some kind of LLAPI magic, super complex and confusing, completely unacceptable for UNET which supposed to be "simple".

    So, this is impossible?

    I am very surprised that there is no information about this super basic and important task in the manual or on the forums.
    Without this feature, UNET is useless for anything except very simple games.
     
    Romenics likes this.
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Doing this isn't simple because networkidentity components on child objects is not a supported use case.

    https://docs.unity3d.com/ScriptReference/Networking.NetworkIdentity.html