Class NetworkTransformChild | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    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.

    Inheritance
    System.Object
    NetworkBehaviour
    NetworkTransformChild
    Inherited Members
    NetworkBehaviour.localPlayerAuthority
    NetworkBehaviour.isServer
    NetworkBehaviour.isClient
    NetworkBehaviour.isLocalPlayer
    NetworkBehaviour.hasAuthority
    NetworkBehaviour.netId
    NetworkBehaviour.connectionToServer
    NetworkBehaviour.connectionToClient
    NetworkBehaviour.playerControllerId
    NetworkBehaviour.syncVarDirtyBits
    NetworkBehaviour.syncVarHookGuard
    NetworkBehaviour.SendCommandInternal(NetworkWriter, Int32, String)
    NetworkBehaviour.InvokeCommand(Int32, NetworkReader)
    NetworkBehaviour.SendRPCInternal(NetworkWriter, Int32, String)
    NetworkBehaviour.SendTargetRPCInternal(NetworkConnection, NetworkWriter, Int32, String)
    NetworkBehaviour.InvokeRPC(Int32, NetworkReader)
    NetworkBehaviour.SendEventInternal(NetworkWriter, Int32, String)
    NetworkBehaviour.InvokeSyncEvent(Int32, NetworkReader)
    NetworkBehaviour.InvokeSyncList(Int32, NetworkReader)
    NetworkBehaviour.RegisterCommandDelegate(Type, Int32, NetworkBehaviour.CmdDelegate)
    NetworkBehaviour.RegisterRpcDelegate(Type, Int32, NetworkBehaviour.CmdDelegate)
    NetworkBehaviour.RegisterEventDelegate(Type, Int32, NetworkBehaviour.CmdDelegate)
    NetworkBehaviour.RegisterSyncListDelegate(Type, Int32, NetworkBehaviour.CmdDelegate)
    NetworkBehaviour.SetSyncVarGameObject(GameObject, GameObject, UInt32, NetworkInstanceId)
    NetworkBehaviour.SetSyncVar<T>(T, T, UInt32)
    NetworkBehaviour.SetDirtyBit(UInt32)
    NetworkBehaviour.ClearAllDirtyBits()
    NetworkBehaviour.PreStartClient()
    NetworkBehaviour.OnNetworkDestroy()
    NetworkBehaviour.OnStartServer()
    NetworkBehaviour.OnStartClient()
    NetworkBehaviour.OnStartLocalPlayer()
    NetworkBehaviour.OnStartAuthority()
    NetworkBehaviour.OnStopAuthority()
    NetworkBehaviour.OnRebuildObservers(HashSet<NetworkConnection>, Boolean)
    NetworkBehaviour.OnSetLocalVisibility(Boolean)
    NetworkBehaviour.OnCheckObserver(NetworkConnection)
    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
    NetworkBehaviour.GetNetworkChannel()

    GetNetworkSendInterval()

    Declaration
    public override float GetNetworkSendInterval()
    Returns
    Type Description
    System.Single
    Overrides
    NetworkBehaviour.GetNetworkSendInterval()

    OnDeserialize(NetworkReader, Boolean)

    Declaration
    public override void OnDeserialize(NetworkReader reader, bool initialState)
    Parameters
    Type Name Description
    NetworkReader reader
    System.Boolean initialState
    Overrides
    NetworkBehaviour.OnDeserialize(NetworkReader, Boolean)

    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
    Overrides
    NetworkBehaviour.OnSerialize(NetworkWriter, Boolean)
    Back to top
    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