docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class BeginPredictedSimulationEntityCommandBufferSystem

    The EntityCommandBufferSystem at the beginning of the PredictedSimulationSystemGroup. This command buffer can update mulitple time per frame on the client, based on the network condition and the frequency of server packet received by the client.

    Inheritance
    object
    ComponentSystemBase
    SystemBase
    EntityCommandBufferSystem
    BeginPredictedSimulationEntityCommandBufferSystem
    Inherited Members
    EntityCommandBufferSystem.m_PendingBuffers
    EntityCommandBufferSystem.CreateCommandBuffer()
    EntityCommandBufferSystem.AddJobHandleForProducer(JobHandle)
    EntityCommandBufferSystem.CreateCommandBuffer(ref UnsafeList<EntityCommandBuffer>, AllocatorManager.AllocatorHandle, WorldUnmanaged)
    EntityCommandBufferSystem.CreateCommandBuffer(ref UnsafeList<EntityCommandBuffer>, WorldUnmanaged)
    EntityCommandBufferSystem.PendingBuffers
    SystemBase.CompleteDependency()
    SystemBase.Update()
    SystemBase.GetComponent<T>(Entity)
    SystemBase.SetComponent<T>(Entity, T)
    SystemBase.HasComponent<T>(Entity)
    SystemBase.HasBuffer<T>(Entity)
    SystemBase.GetComponentLookup<T>(bool)
    SystemBase.GetComponentDataFromEntity<T>(bool)
    SystemBase.GetBuffer<T>(Entity, bool)
    SystemBase.GetBufferLookup<T>(bool)
    SystemBase.GetBufferFromEntity<T>(bool)
    SystemBase.GetEntityStorageInfoLookup()
    SystemBase.GetStorageInfoFromEntity()
    SystemBase.Exists(Entity)
    SystemBase.Dependency
    SystemBase.CheckedStateRef
    SystemBase.Entities
    SystemBase.Job
    ComponentSystemBase.ShouldRunSystem()
    ComponentSystemBase.GetComponentTypeHandle<T>(bool)
    ComponentSystemBase.GetDynamicComponentTypeHandle(ComponentType)
    ComponentSystemBase.GetBufferTypeHandle<T>(bool)
    ComponentSystemBase.GetSharedComponentTypeHandle<T>()
    ComponentSystemBase.GetDynamicSharedComponentTypeHandle(ComponentType)
    ComponentSystemBase.GetEntityTypeHandle()
    ComponentSystemBase.RequireForUpdate(EntityQuery)
    ComponentSystemBase.RequireAnyForUpdate(params EntityQuery[])
    ComponentSystemBase.RequireAnyForUpdate(NativeArray<EntityQuery>)
    ComponentSystemBase.RequireForUpdate<T>()
    ComponentSystemBase.RequireSingletonForUpdate<T>()
    ComponentSystemBase.HasSingleton<T>()
    ComponentSystemBase.GetSingleton<T>()
    ComponentSystemBase.GetSingletonRW<T>()
    ComponentSystemBase.GetSingletonBuffer<T>(bool)
    ComponentSystemBase.TryGetSingleton<T>(out T)
    ComponentSystemBase.TryGetSingletonBuffer<T>(out DynamicBuffer<T>)
    ComponentSystemBase.SetSingleton<T>(T)
    ComponentSystemBase.GetSingletonEntity<T>()
    ComponentSystemBase.TryGetSingletonEntity<T>(out Entity)
    ComponentSystemBase.GetEntityQuery(params ComponentType[])
    ComponentSystemBase.GetEntityQuery(NativeArray<ComponentType>)
    ComponentSystemBase.GetEntityQuery(params EntityQueryDesc[])
    ComponentSystemBase.GetEntityQuery(in EntityQueryBuilder)
    ComponentSystemBase.Enabled
    ComponentSystemBase.EntityQueries
    ComponentSystemBase.GlobalSystemVersion
    ComponentSystemBase.LastSystemVersion
    ComponentSystemBase.EntityManager
    ComponentSystemBase.World
    ComponentSystemBase.SystemHandle
    ComponentSystemBase.SystemHandleUntyped
    ComponentSystemBase.Time
    ComponentSystemBase.WorldUpdateAllocator
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Unity.NetCode
    Assembly: Unity.NetCode.dll
    Syntax
    [WorldSystemFilter(WorldSystemFilterFlags.Default|WorldSystemFilterFlags.ThinClientSimulation, WorldSystemFilterFlags.Default)]
    [UpdateInGroup(typeof(PredictedSimulationSystemGroup), OrderFirst = true)]
    public class BeginPredictedSimulationEntityCommandBufferSystem : EntityCommandBufferSystem
    Remarks

    This system update may not be called on the client if there are no predicted ghost entities. Pending commands may be stale and processed later, when new predicted ghost entities are spawned.

    Pending commands are executed in the same frame they are added to the buffer only in these cases:

    • Commands are queued before the PredictedSimulationSystemGroup update.
    • Commands are queued by a system or job executed inside the PredictedSimulationSystemGroup and the group still has to run at least another tick, either partial or full.
      For the latter case, notice that for application that run at fixed tick rate (i.e the server or the client when v-synced) that is never the case and all commands are always delayed by one tick.

    In general, prefer using the EndPredictedSimulationEntityCommandBufferSystem to queue operation that are expected be executed by the end of the prediction group update or in general in the current frame. For example:

    • spawning entities (predicted spawning) on the client or the server
    • removing / adding components
    In This Article
    Back to top
    Copyright © 2025 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)