Search Unity

object disappears after changing its parent

Discussion in 'Multiplayer' started by meinboi, Sep 12, 2009.

  1. meinboi

    meinboi

    Joined:
    May 13, 2009
    Posts:
    54
    I have an object that is instantiated using Network.Instantiate. why does the object disappear for all clients after changing its parent? It is only visible on the server.

    If I remove that line of code which changes the transform's parent, it works normally.

    Is this a bug or is this expected behavior? Workarounds?
     
  2. lrtitze

    lrtitze

    Joined:
    Aug 27, 2008
    Posts:
    13
    This is likely due to the coordinates of the child object now being relative to the parent at one side of the network, while others still believe the coordinates to be relative to the world.

    Take a look for the object close to 0,0,0 and you may find that it hasn't actually disappeared.
     
  3. cboxgo

    cboxgo

    Joined:
    Oct 9, 2014
    Posts:
    8
    I know this is an old post but this seems to still happen. My solution was to rescale the transform after making it a child as Unity appears to set the x,y,z scale to all zero. I hope this helps!
     
    huloo likes this.