Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

NetCode: Add Ghost to Collection without Prefab?

Discussion in 'NetCode for ECS' started by myxolobe, Nov 22, 2020.

  1. myxolobe

    myxolobe

    Joined:
    Dec 7, 2016
    Posts:
    9
    I'm using NetCode and I have a ghost that I'd like the server to generate on initialization for terrain rendering. I could create a dummy prefab for this ghost and add it to the collection on my "Ghost Collection Authoring Component" but I think it's overkill to force entity conversion when it's not necessary: my system does all the work and doesn't require this overhead. I could potentially have many of these semi-stateless environmental systems for presentation - and I want the server to decide which ones are active at any time.

    So, can I create ghost definitions programmatically at runtime? How or why not?
     
  2. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    910
    Is the terrain moving? Why do you need ghosts?
     
  3. myxolobe

    myxolobe

    Joined:
    Dec 7, 2016
    Posts:
    9
    It was only rendering on the server, regardless which UpdateInGroup I assigned to it. I guess I'm reaching for solutions here making it a ghost, I want it to render on both the host and clients.

    Also I might enable it to send and receive RPC calls.