Skip to content

Commit 197f4b0

Browse files
update
XML API update
1 parent 46d1854 commit 197f4b0

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,6 +1444,10 @@ internal bool SynchronizeScale
14441444
/// This is synchronized by authority. During runtime, this should only be changed by the
14451445
/// authoritative side. Non-authoritative instances will be overridden by the next
14461446
/// authoritative state update.
1447+
///
1448+
/// !! Note !! <br />
1449+
/// When <see cref="SwitchTransformSpaceWhenParented"/> is enabled, this field will be automatically
1450+
/// adjusted. It is not recommended adjusting this field during runtime and when <see cref="SwitchTransformSpaceWhenParented"/> is enabled.
14471451
/// </remarks>
14481452
[Tooltip("Sets whether this transform should sync in local space or in world space")]
14491453
public bool InLocalSpace = false;
@@ -1457,7 +1461,9 @@ internal bool SynchronizeScale
14571461
/// <remarks>
14581462
/// Only works with <see cref="NetworkTransform"/> components that are not paired with a <see cref="NetworkRigidbody"/> or <see cref="NetworkRigidbody2D"/> component that is configured to use the rigid body for motion.<br />
14591463
/// <see cref="TickSyncChildren"/> will automatically be set when this is enabled.
1460-
/// Does not auto-synchronize clients if changed on the authority instance during runtime (i.e. apply this setting in-editor).
1464+
/// This field is not auto-synchronize with non-authority clients if changed on the authority instance during runtime (i.e. apply this setting in-editor).
1465+
/// !! Note !! <br />
1466+
/// It is highly recommended to read the companion NetworkTransform documentation regarding this feature to avoid improper usage.
14611467
/// </remarks>
14621468
public bool SwitchTransformSpaceWhenParented = false;
14631469

@@ -3896,7 +3902,9 @@ internal override void InternalOnNetworkObjectParentChanged(NetworkObject parent
38963902
/// This will override any changes made previously to the transform
38973903
/// This isn't resistant to network jitter. Server side changes due to this method won't be interpolated.
38983904
/// The parameters are broken up into pos / rot / scale on purpose so that the caller can perturb
3899-
/// just the desired one(s)
3905+
/// just the desired one(s).
3906+
/// !! Note !! <br />
3907+
/// It is not recommended to use this method during the spawn sequence. Refer to the NetworkTransform documentation for more information on the recommended usage.
39003908
/// </summary>
39013909
/// <param name="posIn">new position to move to. Can be null</param>
39023910
/// <param name="rotIn">new rotation to rotate to. Can be null</param>
@@ -4033,10 +4041,12 @@ private void SetStateServerRpc(Vector3 pos, Quaternion rot, Vector3 scale, bool
40334041

40344042
/// <summary>
40354043
/// Teleport an already spawned object to the given values without interpolating.
4044+
/// !! Note !! <br />
4045+
/// It is not recommended to use this method during the spawn sequence. Refer to the NetworkTransform documentation for more information on the recommended usage.
40364046
/// </summary>
40374047
/// <remarks>
40384048
/// This is intended to be used on already spawned objects, for setting the position of a dynamically spawned object just apply the transform values prior to spawning. <br />
4039-
/// With player objects, override the <see cref="OnNetworkSpawn"/> method and have the authority make adjustments to the transform prior to invoking base.OnNetworkSpawn.
4049+
/// With player objects, override the <see cref="OnNetworkSpawn"/> method and have the authority make adjustments to the transform prior to invoking base.OnNetworkSpawn. <br />
40404050
/// </remarks>
40414051
/// <param name="newPosition">new position to move to.</param>
40424052
/// <param name="newRotation">new rotation to rotate to.</param>

com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1941,6 +1941,12 @@ public void Spawn(bool destroyWithScene = false)
19411941
/// <summary>
19421942
/// Spawns a <see cref="NetworkObject"/> across the network with a given owner. Can only be called from server
19431943
/// </summary>
1944+
/// <remarks>
1945+
/// When using a client-server or distributed authority network topology, you should take into consideration any components
1946+
/// that might require ownership checks while running through the spawn process. To avoid issues that could arise by initialy spawning
1947+
/// without ownership, it is recommended to use <see cref="Spawn"/> first, so it is spawned as both the owner and the authority, and then use <see cref="ChangeOwnership(ulong)"/>
1948+
/// to change the ownership to the intended client.<br />
1949+
/// </remarks>
19441950
/// <param name="clientId">The clientId to own the object</param>
19451951
/// <param name="destroyWithScene">Should the object be destroyed when the scene is changed</param>
19461952
public void SpawnWithOwnership(ulong clientId, bool destroyWithScene = false)

0 commit comments

Comments
 (0)