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

Is there an Example for Spawning Predicted Ghosts and using MarkPredictedGhosts?

Discussion in 'Entity Component System' started by Michael-Thomas, Jan 15, 2020.

  1. Michael-Thomas

    Michael-Thomas

    Joined:
    Jul 8, 2014
    Posts:
    20
    In my exploration of the DOTS Sample project, I am attempting to modify the weapon by making it fire a projectile (like a rocket). The NetCode docs say:

    "You can extend the entity-specific spawning by implementing a partial class of the same name as the generated spawn class. You can call the MarkPredictedGhosts function so that you can assign a specific ID for that type of prediction. This method must contain user defined logic to match a ghost from the server with a predicted spawned local entity."

    Is there an example of this someone can point me to? I am guessing this is not actually that complicated but without a little more info I'm uncertain how to accomplish this.

    This feels like the kind of thing that once someone points me at the right thing I'm going to feel dumb for having had to ask. :)
     
  2. MaverickROM

    MaverickROM

    Joined:
    Mar 19, 2019
    Posts:
    11
    Michael-Thomas likes this.
  3. Michael-Thomas

    Michael-Thomas

    Joined:
    Jul 8, 2014
    Posts:
    20
    Thanks, Maverick - I had not found that and it is very relevant.
     
    MaverickROM likes this.