You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// 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 />
1459
1463
/// <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.
/// This will override any changes made previously to the transform
3897
3903
/// This isn't resistant to network jitter. Server side changes due to this method won't be interpolated.
3898
3904
/// 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.
3900
3908
/// </summary>
3901
3909
/// <param name="posIn">new position to move to. Can be null</param>
3902
3910
/// <param name="rotIn">new rotation to rotate to. Can be null</param>
/// 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.
4036
4046
/// </summary>
4037
4047
/// <remarks>
4038
4048
/// 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 />
4040
4050
/// </remarks>
4041
4051
/// <param name="newPosition">new position to move to.</param>
4042
4052
/// <param name="newRotation">new rotation to rotate to.</param>
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1941,6 +1941,12 @@ public void Spawn(bool destroyWithScene = false)
1941
1941
/// <summary>
1942
1942
/// Spawns a <see cref="NetworkObject"/> across the network with a given owner. Can only be called from server
1943
1943
/// </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>
1944
1950
/// <param name="clientId">The clientId to own the object</param>
1945
1951
/// <param name="destroyWithScene">Should the object be destroyed when the scene is changed</param>
0 commit comments