Search Unity

Feedback GhostAuthoringComponent: Change to bake GhostOwner with NetworkId -1 by default

Discussion in 'NetCode for ECS' started by optimise, Nov 7, 2023.

  1. optimise


    Jan 22, 2014
    I would like official to change GhostAuthoringComponent authoring to bake NetworkId = -1 into GhostOwner by default to solve error log when the ghost is act as npc that is not owned by any player since currently GhostAuthoringComponent authoring is bake GhostOwner with NetworkId = 0 by default when tick HasOwner flag.
  2. NikiWalker


    Unity Technologies

    May 18, 2021
    Do you mean this error:
    Trying to spawn an owner predicted ghost which does not have a valid owner set. When using owner prediction you must set GhostOwner.NetworkId when spawning the ghost. If the ghost is not owned by a player you can set NetworkId to -1.

    If you do: This error exists to warn the user that they have not setup a GhostOwner. As suggested, it is trivial to instead set it to -1 upon spawn yourself, to identify it as an NPC. Therefore, we will not be making this change.