Synchronization with ghosts
Use ghosts to synchronize and replicate states between server and clients in a consistent and customizable way.
Topic | Description |
---|---|
Ghosts and snapshots | Understand ghosts and snapshots in Netcode for Entities and how to use them to synchronize states in your multiplayer project. |
Serialization and synchronization with GhostFieldAttribute |
Use GhostFieldAttribute to specify which fields and properties of Unity.Entities.IComponentData or Unity.Entities.IBufferElementData should be serialized and replicated from server to client. |
Customizing replication with GhostComponentAttribute |
Use GhostComponentAttribute and its properties to customize how replication is handled by your runtime. |
Creating replication schemas with GhostComponentVariationAttribute |
Use GhostComponentVariationAttribute to declare a replication schema for a type (at compile time) without needing to mark up fields in the original type, or the original type itself. |
Spawning and pre-spawning ghosts | Spawn ghosts as part of your game after creating them and defining how they should be synchronized. |
Ghost type templates | Netcode for Entities has default templates that define how ghost component types are handled during baking and serialization. You can also create your own templates to register additional types. |
Ghost groups | Use ghost groups to synchronize replication timings across multiple ghost instances and prevent common gameplay state errors. |