Skip to content

Update networkobject.md #860

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/basics/networkobject.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ NetworkManager.Singleton.ConnectedClients[clientId].PlayerObject;
To find your own player object just pass `NetworkManager.Singleton.LocalClientId` as the clientId in the sample above.

### Network Prefabs
Network prefabs (NetworkPrefabs) are prefabs that contain a GameObject with a `NetworkObject` component. As an example, if you wanted to create a prefab to be the default player prefab, then you would create a prefab that at the root GameObject included a `NetworkObject` component and any additional player specific `NetworkBehabiour` components. You can then assign that prefab to the `NetworkManager` Player Prefab property to be used when a player is connected and approved. Each connected player will have a unique instance spawned on all connected clients (including the server).
Network prefabs (NetworkPrefabs) are prefabs that contain a GameObject with a `NetworkObject` component. As an example, if you wanted to create a prefab to be the default player prefab, then you would create a prefab that at the root GameObject included a `NetworkObject` component and any additional player specific `NetworkBehaviour` components. You can then assign that prefab to the `NetworkManager` Player Prefab property to be used when a player is connected and approved. Each connected player will have a unique instance spawned on all connected clients (including the server).

:::note
You can only have one `NetworkObject` at the root of a prefab. This means do not create prefabs with nested `NetworkObjects`!
Expand Down