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
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/Documentation~/basics/scenemanagement/inscene-placed-networkobjects.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -186,11 +186,11 @@ public class MyInSceneNetworkObjectBehaviour : NetworkBehaviour
186
186
187
187
### Pre-disabled in-scene placed NetworkObjects
188
188
189
-
If you want to always have an in-scene placed NetworkObject start off as disabled and then spawn it at a later time, you only need to set its GameObject to inactive in the editor while the respective scene is open. Once you have started a networked session, you can re-enable it and then spawn it any time.
189
+
To initialize an in-scene placed NetworkObject in a disabled state and spawn it later, set its GameObject to inactive in the Editor while the respective scene is open. Once a networked session begins, you can re-enable and spawn it at any time.
190
190
191
191
### Setting an in-scene placed NetworkObject to a despawned state when instantiating
192
192
193
-
If you want to programmatically disable an in-scene placed NetworkObject you can add some additional code in the `OnNetworkSpawn` part of a NetworkBehaviour component:
193
+
To programmatically disable an in-scene placed NetworkObject, add some additional code in the `OnNetworkSpawn` part of a NetworkBehaviour component:
The following provides the validity requirements for both types.
29
29
30
-
#### Dynamically instantiated network prefabs.
30
+
#### Dynamically instantiated network prefabs
31
31
32
-
Requirements
32
+
Dynamically instantiated network prefabs must:
33
33
34
-
*It must be a valid [network prefab](./networkobject.md#network-prefabs) created within the editor.
35
-
*It must be registered within a network prefab list that is assigned to your NetworkManager.
34
+
*Be a valid [network prefab](./networkobject.md#network-prefabs) created within the Editor.
35
+
*Be registered in a network prefab list that's assigned to your NetworkManager.
36
36
37
-
#### In-scene placed
37
+
#### In-scene placed network prefabs
38
38
39
-
Requirements
39
+
In-scene placed network prefabs must:
40
40
41
-
*It can be a valid network prefab instance within a scene.
42
-
*It can be a GameObject with a `NetworkObject` component created within the scene while in the editor.
41
+
*Be a valid network prefab instance within a scene.
42
+
*Be a GameObject with a NetworkObject component created within the scene while in the Editor.
43
43
44
44
### What is an invalid NetworkObject?
45
45
46
-
Any GameObjects that have `NetworkObject` components added to them during runtime is**not supported** and will result in the NetworkObject's `GlobalObjectIdHash` being zero which would eventually result in synchronization issues. In the event you make this mistake, a warning message will be logged and the NetworkObject will not get spawned.
46
+
GameObjects that have NetworkObject components added to them during runtime are**not supported** and will result in the NetworkObject's `GlobalObjectIdHash` being zero, which causes synchronization issues. In the event you make this mistake, a warning message will be logged and the NetworkObject won't be spawned.
0 commit comments