-
Notifications
You must be signed in to change notification settings - Fork 457
Closed
Labels
priority:lowThis issue has low priority and will take some time to be resolvedThis issue has low priority and will take some time to be resolvedstat:importedStatus - Issue is tracked internally at UnityStatus - Issue is tracked internally at Unitytype:bugBug ReportBug Report
Description
Description
Instantiating a NetworkObject prefab and passing in a NetworkObject parent causes the client to error with NotServerException
.
Reproduce Steps
- Start server
- Connect with client
- Instantiate a NetworkObject prefab on server. Store as
someOtherNetworkObject
. (This also works with an in-scene NetworkObject). - Instantiate a NetworkObject prefab on server with
Instantiate(prefab, Vector3.zero, Quaternion.identity, someOtherNetworkObject)
.
Actual Outcome
Client produces error of NotServerException: Only the server can reparent NetworkObjects
and NetworkObject is not reparented.
Expected Outcome
Object is reparented on client with no error.
Environment
- OS: Windows
- Unity Version: 2021.3.2f1
- Netcode Version: 1.0.0-pre.9
Additional Context
As a workaround, instantiating the GameObject, spawning, then reparenting works. Ideally though this would work automatically, or at least give a message that spawned NetworkObjects should have a null parent.
Metadata
Metadata
Assignees
Labels
priority:lowThis issue has low priority and will take some time to be resolvedThis issue has low priority and will take some time to be resolvedstat:importedStatus - Issue is tracked internally at UnityStatus - Issue is tracked internally at Unitytype:bugBug ReportBug Report