Class NetCodePhysicsConfig
Component used to enable predicted physics automatic world changing(PredictedPhysicsNonGhostWorld) and lag compensation (EnableLagCompensation) and tweak their settings. At conversion time, a singleton entity is added to the scene/subscene if either one of, or both of the features are enabled, and the PredictedPhysicsNonGhostWorld, EnableLagCompensation components are automatically added to it based on these settings.
Inherited Members
Namespace: Unity.NetCode
Syntax
[DisallowMultipleComponent]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.netcode@latest/index.html?subfolder=/api/Unity.NetCode.NetCodePhysicsConfig.html")]
public sealed class NetCodePhysicsConfig : MonoBehaviour
Fields
ClientHistorySize
The number of physics world states that are backed up on the client. This cannot be more than the maximum capacity, leaving it at zero will give oyu the default which is one.
Declaration
[Tooltip("The number of physics world states that are backed up on the client. This cannot be more than the maximum capacity, leaving it at zero will give oyu the default which is one.")]
public int ClientHistorySize
Field Value
Type | Description |
---|---|
Int32 |
ClientNonGhostWorldIndex
When using predicted physics all dynamic physics objects in the main physics world on the client mus be ghosts. Setting this will move any non-ghost in the default physics world to another world.
Declaration
[Tooltip("The physics world index to use for all dynamic physics objects which are not ghosts.")]
public uint ClientNonGhostWorldIndex
Field Value
Type | Description |
---|---|
UInt32 |
EnableLagCompensation
Set to true to enable the use of the LagCompensation system. Server and Client will start recording the physics world state in the PhysicsWorldHistory buffer, which size can be further configured for by changing the ServerHistorySize and ClientHistorySize properites;
Declaration
[Tooltip("Enable/Disable the LagCompensation system. Server and Client will start recording the physics world state in the PhysicsWorldHistory buffer")]
public bool EnableLagCompensation
Field Value
Type | Description |
---|---|
Boolean |
ServerHistorySize
The number of physics world states that are backed up on the server. This cannot be more than the maximum capacity, leaving it at zero will give you the default which is max capacity.
Declaration
[Tooltip("The number of physics world states that are backed up on the server. This cannot be more than the maximum capacity, leaving it at zero will give you the default which is max capacity")]
public int ServerHistorySize
Field Value
Type | Description |
---|---|
Int32 |