com.unity.netcode.gameobjects
com.unity.netcode.gameobjects copied to clipboard
Multiplayer Playmode: fails to load MonoBehaviour scripts located in a embedded package
Description
MonoBehaviour components located in an embedded package are non-functional (not loaded, not running), and appear as "(Script)" in virtual player inspectors:
These components are not loaded and won't do anything. A log in Awake() does not appear in the console of the virtual player (log appears in main editor).
This leaves all MonoBehaviour that are in embedded packages broken and unusable within virtual players!
The above components are located in a package in /Packages/de.codesmile.netcode/Runtime/Components/.. The TEst component was originally under /Assets where it worked fine but after moving it into the same package folder as NetworkEventLogger it stopped working too.
The packages-lock.json seems to have been updated correctly, with the package type changing from 'embedded' to 'local':
"version": "file:de.codesmile.netcode",
"depth": 0,
"source": "embedded",
"version": "file:../../../../Packages/de.codesmile.netcode",
"depth": 0,
"source": "local",
I have closed the project, deleted the entire Library folder, and tried again with the same result. There were no console messages when activating the virtual player or entering playmode.
Reproduce Steps
Create a local package under /Packages/package-name Create a MonoBehaviour script with a Debug.Log in Awake() Add the script to a GameObject in the scene Activate a virtual player Enter playmode in that scene Check the virtual player's Inspector for "(Script)"
Move the script to Assets to see that this fixes the issue.
Environment
- OS: Win 11
- Unity Version: 6000.0.12f1
- Netcode Version: 1.9.1
- MPPM Version: 1.2.1
Notes: I also downgraded to MPPM 1.0.0, deleted Library, and had the same issue.
Reported with test case as:
CASE IN-81312
Hi, since the issue you reported in CASE IN-81312 seems to be resolved, I will be closing this issue. Feel free to reopen it if the issue persist