Search Unity

Help Wanted Mirror - Player pickup and drop objects

Discussion in 'Multiplayer' started by brainwipe, Oct 27, 2020.

  1. brainwipe

    brainwipe

    Joined:
    Aug 21, 2017
    Posts:
    40
    I want a player to pick up an object from the world and put it into a machine. When the player is holding the item, all the other players must see them holding it.

    I've read through and understood the Mirror example.

    This example suggests that the only way to do this is to destroy the game object on the server and create it on all the clients attached to the player. This, as I understand it, is because you can't have more than one NetworkIdentity in a hierarchy.

    When I "drop" the item back into the world, it must be destroyed and recreated again.

    Is this correct? Does anyone know of a better way?
     
  2. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    728
    @brainwipe indeed, there is no way to have nested networked objects. It is just a can of worm we can't really solve.

    So your description sounds about right.
     
    brainwipe likes this.
unityunity