Search Unity

Question Baker running 3 times

Discussion in 'Entity Component System' started by Phenotype, Nov 20, 2022.

  1. Phenotype

    Phenotype

    Joined:
    Oct 26, 2010
    Posts:
    53
    All my bakers run three times on start, one for each primary world it seems as I end up with a baked entity in each world; default, client and server. I would think it should only run for the DefaultGameObjectInjectionWorld. Implementing a Baking System just hits all three entity. Am I missing something to restrict the baking system to run for just one world? Also, is there a way to specify the output should be sent to a specific world, overriding the injection world?
     
  2. Phenotype

    Phenotype

    Joined:
    Oct 26, 2010
    Posts:
    53
    Update: this is a netcode/baking problem. After removing netcode the baker only bakes one entity for the default world. I don't know if this is a "bug" but it certainly is a shortcoming of the baker and baking system. I should be able to specify where a baked entity lands. One kludgy solution is to remove the unwanted entities from the worlds they shouldn't exist but that is only a temporary hack. It would seem this could be handled with Attributes on the baker that specify which world to bake the entity to, though some fine tuning may be required.
     
  3. WAYNGames

    WAYNGames

    Joined:
    Mar 16, 2019
    Posts:
    992
    I haven't used NetCode but isn't that handled at the subscene level ?

    Isn't there a way to specify a subscene is either client / server or both ??
     
  4. Phenotype

    Phenotype

    Joined:
    Oct 26, 2010
    Posts:
    53
    If it is possible I'm not aware of how to do it. Nothing on the subscene component. Still, that wouldn't be enough. I could have other worlds; staging, regions, etc. not just client/server.