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 |