Class NetworkTransformChild
A component to synchronize the position of child transforms of networked objects.
There must be a NetworkTransform on the root object of the hierarchy. There can be multiple NetworkTransformChild components on an object. This does not use physics for synchronization, it simply synchronizes the localPosition and localRotation of the child transform and lerps towards the recieved values.
Inherited Members
Namespace: UnityEngine.Networking
Syntax
[Obsolete("The high level API classes are deprecated and will be removed in the future.")]
public class NetworkTransformChild : NetworkBehaviour
Properties
childIndex
A unique Identifier for this NetworkTransformChild component on this root object.
Declaration
public uint childIndex { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt32 |
clientMoveCallback3D
A callback function to allow server side validation of the movement of the child object.
Declaration
public NetworkTransform.ClientMoveCallback3D clientMoveCallback3D { get; set; }
Property Value
| Type | Description |
|---|---|
| NetworkTransform.ClientMoveCallback3D |
interpolateMovement
The rate to interpolate towards the target position.
A value of 1 will snap to the position, and lower positive values will interpolate more slowly.
Declaration
public float interpolateMovement { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
interpolateRotation
The rate to interpolate to the target rotation.
A value of 1 will snap to the position, and lower positive values will interpolate more slowly.
Declaration
public float interpolateRotation { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
lastSyncTime
The most recent time when a movement synchronization packet arrived for this object.
Declaration
public float lastSyncTime { get; }
Property Value
| Type | Description |
|---|---|
| System.Single |
movementThreshold
The distance that an object can move without sending a movement synchronization update.
This applies to the child object's localPosition, not it's world position.
Declaration
public float movementThreshold { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
rotationSyncCompression
How much to compress rotation sync updates.
Declaration
public NetworkTransform.CompressionSyncMode rotationSyncCompression { get; set; }
Property Value
| Type | Description |
|---|---|
| NetworkTransform.CompressionSyncMode |
sendInterval
The sendInterval controls how often state updates are sent for this object.
Declaration
public float sendInterval { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
syncRotationAxis
Which axis should rotation by synchronized for.
Declaration
public NetworkTransform.AxisSyncMode syncRotationAxis { get; set; }
Property Value
| Type | Description |
|---|---|
| NetworkTransform.AxisSyncMode |
target
The child transform to be synchronized.
Declaration
public Transform target { get; set; }
Property Value
| Type | Description |
|---|---|
| Transform |
targetSyncPosition
The target position interpolating towards.
Declaration
public Vector3 targetSyncPosition { get; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
targetSyncRotation3D
The target rotation interpolating towards.
Declaration
public Quaternion targetSyncRotation3D { get; }
Property Value
| Type | Description |
|---|---|
| Quaternion |
Methods
GetNetworkChannel()
Declaration
public override int GetNetworkChannel()
Returns
| Type | Description |
|---|---|
| System.Int32 |
Overrides
GetNetworkSendInterval()
Declaration
public override float GetNetworkSendInterval()
Returns
| Type | Description |
|---|---|
| System.Single |
Overrides
OnDeserialize(NetworkReader, Boolean)
Declaration
public override void OnDeserialize(NetworkReader reader, bool initialState)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkReader | reader | |
| System.Boolean | initialState |
Overrides
OnSerialize(NetworkWriter, Boolean)
Declaration
public override bool OnSerialize(NetworkWriter writer, bool initialState)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkWriter | writer | |
| System.Boolean | initialState |
Returns
| Type | Description |
|---|---|
| System.Boolean |