{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Struct GhostSpawnBuffer | Netcode for Entities | 1.1.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct GhostSpawnBuffer

    The GhostSpawnBuffer is the data for a GhostSpawnQueue singleton. It contains a list of ghosts which will be spawned by the GhostSpawnSystem at the beginning of next frame. It is populated by the GhostReceiveSystem and there needs to be a classification system updating after the GhostReceiveSystem which sets the SpawnType so the spawn system knows how to spawn the ghost. A classification system should only modify the SpawnType and PredictedSpawnEntity fields of this struct. InternalBufferCapacity allocated to almost max out chunk memory.

    Implements
    IBufferElementData
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Unity.NetCode
    Assembly: solution.dll
    Syntax
    [InternalBufferCapacity(240)]
    public struct GhostSpawnBuffer : IBufferElementData

    Fields

    Name Description
    DataOffset

    Offset im bytes used to retrieve from the temporary SnapshotDataBuffer, present on the GhostSpawnQueue singleton, the first received snapshot from the server.

    DynamicDataSize

    The size of the initial dynamic buffers data associated with the entity.

    GhostID

    The ghost id that will be assigned to the new ghost instance.

    GhostType

    The index of the ghost type in the GhostCollectionPrefab collection to use to spawn to ghost.

    PredictedSpawnEntity

    Entity reference assigned by a classification system, when a predicted spawned entity for a newly received ghost is found. When assigning this HasClassifiedPredictedSpawn should also be set to true. If the referenced entity is different than Null the ghost type must be set to Predicted.

    ServerSpawnTick

    The tick this ghost was spawned on the server. For any predicted spawning this is the tick that should match since you are interested in when the server spawned the ghost, not when the server first sent the ghost to the client. Using this also means you are not considering ghosts becoming relevant as spawning.

    SpawnType

    The type of ghost to spawn. Based on the spawn type, some components may be enable/disabled or removed from the instantiated ghost.

    Properties

    Name Description
    HasClassifiedPredictedSpawn

    Should be set to true when a ghost classification system has processed this particular ghost spawn instance. It will then not be processed again in a system running later in the frame (like the default classification system).

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)