Search Issue Tracker
Active
Planned for 2021.3.X, 2022.1.X, 2022.2.X, 2023.1.X
Votes
1
Found in
2021.3.5f1
2022.1.6f1
2022.2.0a17
2023.1.0a1
Issue ID
UUM-7264
Regression
No
UNITY_SERVER scripting define does not work when switching to Dedicated Server from Windows by script
How to reproduce:
1. Open attached project "ServerBuildScriptingDefine.zip" and scene "SampleScene"
2. In Build Settings window, switch to Windows, Mac, Linux platform.
3. In Editor Menu, click Bug -> Repro
4. After the build completes, observe Dedicated Server build's logs
Expected result: "It's a server\!" messages are logged
Actual result: "It's a server\!" messages are not logged
Reproducible with: 2021.2.0b5, 2022.1.0a4
Could not test with: 2019.4.29f1, 2020.3.15f1, 2021.1.16f1 (Dedicated Server functionality not implemented)
Note:
Issue does not reproduce when the platform is set to Dedicated Server prior to executing the script.
Note:
Issue is not restricted to dedicated server builds. Any time a call to BuildPipeline.BuildPlayer builds a player which platform and subtarget does not match the current active platform in the editor the issue will manifest itself. When platform is manually switched in the Editor's BuildPlayerWindow the problem does not occur because the editor window can detect when there's a mismatch and wait for scripts to be reloaded/recompiled with the new platform compiler macros to start the build. A temporary workaround for users relying on BuildPipeline.BuildPlayer would be to trigger the build a second time if unsure of what was the current active build platform or a reload scripts dialog appears right after the build is completed without the user changing anything.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [VFX Graph] Lit/Unlit particles are not compiled with new ShaderGraph integration
- Terrain is not affected by Environmental Lighting when Draw Instanced is turned on
- UI Toolkit: Gaps between VisualElements with Grow 1, when scaled with "Scale With Screen Size"
- Scrollbar does not appear in ScrollView when flex-grow of TextField is set to 1
- [Linux] Editor crashes at "DisconnectGtkSignal(void*, GtkCallbackResponse (*)(), void*)" when opening floating windows
ArjanBroosSioux
Apr 14, 2022 08:33
How then, do we wait for domain reload from a script run in batch mode?