-
Notifications
You must be signed in to change notification settings - Fork 450
test: Nested NetworkObjects in prefabs throws a warning [MTT-2976] #1969
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
Conversation
Hi @TwoTenPvP, in our project we have Prefabs that have root a NetworkObject and nested NetworkObjects. We've handled them with a component that will unparent them on Awake (upon instantiation, but before network spawning) and that will Spawn them on the next network tick following the network spawning of the root NetworkObject. On the client side, we have a PrefabHandler registered dynamically that will provide the nested NetworkObject instance, the one obtained from the prefab instantiation and that was unparented on Awake, to the spawn call therefore binding their network "identities" without doing an extra instantiation / duplication. It allows us to have nested NetworkObjects in the editor (in the prefabs) which help us visualizing / positioning them, but as soon as their parent is spawn, they are unparented and spawned as well without duplication (we bind the existing instance, not doing another Instantiate). We find that pretty convenient. Are you sure you want to enforce such restrictions with an editor check? How about a warning instead? 👀 |
Hello! It has been done with a warning now. |
Co-authored-by: Fatih Mar <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Prevents nested NetworkObjects from existing and being created.
MTT-2976
Changelog
Testing and Documentation