Skip to content

Network objects not parenting properly when spawned at runtime #2358

@TheCaveOfWonders

Description

@TheCaveOfWonders

I have a UI scene akin to a lobby, with an in-scene player list that's a network object, when a player connects, a player row prefab, also a network object, gets instantiated on the server side and added to that player list, NOT using SetParent, but using Addressables.InstantiateAsync and providing the player list as a parent, then the server spawns that prefab.

Scene:
-Canvas (in scene network object)
--Some Panels (in scene objects)
---Player List (in scene network object)
----Player1 Row (run-time network object)
----Player2 Row (run-time network object)
----Player3 Row (run-time network object)

This was working perfectly fine for a long while, I believe after the update to 1.1.0 it broke, and in 1.2.0 it still doesn't work.

The problem:
on the client side, the player row is always at the root of the scene instead of being under the player list.

Am I doing something wrong here? what changed that's causing this to break?
I tried messing around with the "Auto Object Parent Sync" for the player list and the player row, but that didn't help either. Also tried using SetParent on the player row, instead of having the Addressables.InstantiateAsync set the parent, but that didn't help.

What is the proper way of handling this type of network parenting?

Metadata

Metadata

Labels

priority:mediumThis issue has medium priority and may take some time to be resolvedstat:importedStatus - Issue is tracked internally at Unitytype:bugBug Report

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions