Class NetworkTransform
A prototype component for syncing transforms
Inherited Members
Namespace: MLAPI.Prototyping
Assembly: Unity.Multiplayer.MLAPI.Prototyping.dll
Syntax
[AddComponentMenu("MLAPI/NetworkTransform")]
public class NetworkTransform : NetworkBehaviour
Fields
AssumeSyncedSends
Is the sends per second assumed to be the same across all instances
Declaration
[Tooltip("This assumes that the SendsPerSecond is synced across clients")]
public bool AssumeSyncedSends
Field Value
| Type | Description |
|---|---|
| bool |
Channel
The channel to send the data on
Declaration
[Tooltip("The channel to send the data on. Uses the default channel if left unspecified")]
public string Channel
Field Value
| Type | Description |
|---|---|
| string |
DistanceSendrate
The curve to use to calculate the send rate
Declaration
public AnimationCurve DistanceSendrate
Field Value
| Type | Description |
|---|---|
| AnimationCurve |
EnableNonProvokedResendChecks
Checks for missed sends without provocation. Provocation being a client inside it's normal SendRate
Declaration
public bool EnableNonProvokedResendChecks
Field Value
| Type | Description |
|---|---|
| bool |
EnableRange
Enables range based send rate
Declaration
public bool EnableRange
Field Value
| Type | Description |
|---|---|
| bool |
ExtrapolatePosition
Enables extrapolation
Declaration
public bool ExtrapolatePosition
Field Value
| Type | Description |
|---|---|
| bool |
FixedSendsPerSecond
The base amount of sends per seconds to use when range is disabled
Declaration
[Range(0, 120)]
public float FixedSendsPerSecond
Field Value
| Type | Description |
|---|---|
| float |
InterpolatePosition
Enable interpolation
Declaration
[Tooltip("This requires AssumeSyncedSends to be true")]
public bool InterpolatePosition
Field Value
| Type | Description |
|---|---|
| bool |
InterpolateServer
Should the server interpolate
Declaration
public bool InterpolateServer
Field Value
| Type | Description |
|---|---|
| bool |
IsMoveValidDelegate
If set, moves will only be accepted if the custom delegate returns true
Declaration
public NetworkTransform.MoveValidationDelegate IsMoveValidDelegate
Field Value
| Type | Description |
|---|---|
| NetworkTransform.MoveValidationDelegate |
MaxSendsToExtrapolate
The maximum amount of expected send rates to extrapolate over when awaiting new packets. A higher value will result in continued extrapolation after an object has stopped moving
Declaration
public float MaxSendsToExtrapolate
Field Value
| Type | Description |
|---|---|
| float |
MinDegrees
The min degrees to rotate before a send it sent
Declaration
public float MinDegrees
Field Value
| Type | Description |
|---|---|
| float |
MinMeters
The min meters to move before a send is sent
Declaration
public float MinMeters
Field Value
| Type | Description |
|---|---|
| float |
SnapDistance
The distance before snaping to the position
Declaration
[Tooltip("The transform will snap if the distance is greater than this distance")]
public float SnapDistance
Field Value
| Type | Description |
|---|---|
| float |
Methods
NetworkStart()
Registers message handlers
Declaration
public override void NetworkStart()
Overrides
Teleport(Vector3, Quaternion)
Teleports the transform to the given position and rotation
Declaration
public void Teleport(Vector3 position, Quaternion rotation)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The position to teleport to |
| Quaternion | rotation | The rotation to teleport to |