docs.unity3d.com
    Show / Hide Table of Contents

    Struct PredictedPhysicsConfig

    A component used as a singleton to control the use of physics in ghost prediction. When the singleton exists all physics systems, and systems with ordering contraints against physics systems ([UpdateBefore], [UpdateAfter]) are moved into the ghost prediction system group and run as part of prediction. The singleton must be added on both the client and server with compatible values. When using physics simulation in prediction all dynamic physics objects must be ghosts. When netcode is present it will add a PhysicsMassOverride to all ghosts with dynamic physics on the client, this means it is not possible to use PhysicsMassOverride for game specific purposes on ghosts.

    Namespace: Unity.NetCode
    Syntax
    public struct PredictedPhysicsConfig : IComponentData

    Fields

    DisableWhenNoConnections

    If set to true the predicted physics will not update when there are no connections. This can be used to reduce the simulation cost for idle servers.

    Declaration
    public bool DisableWhenNoConnections
    Field Value
    Type Description
    Boolean

    PhysicsTicksPerSimTick

    The number of physics step to perform for each prediction simulation step. This for example allows you to run 60Hz simulation with 120Hz physics if set to 2.

    Declaration
    public int PhysicsTicksPerSimTick
    Field Value
    Type Description
    Int32
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023