Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Unity Multiplayer Unity 2021.2: Dedicated Server target and stripping optimizations now live! Please share feedback!

Discussion in 'Multiplayer' started by UnityGio, Jul 20, 2021.

  1. Spitap

    Spitap

    Joined:
    Jan 10, 2021
    Posts:
    3
    What a fast answer ! thank you !! adding it to my script right away :)
    Even if it's not completely set, it would be nice to add it in the documentation, or have an in development page with a bunch of dev stuff :).
     
    cristianm_unity likes this.
  2. Spitap

    Spitap

    Joined:
    Jan 10, 2021
    Posts:
    3
    HI, I've found a bug. I'll fill a bug report tomorrow, but here is a general description : If you try to open a project in batchmode with subsystem option (command used : ./Unity -batchmode -nographics -standaloneBuildSubtarget "Server" -projectPath "pathToProject/") it will do a core dump if library hasn't yet be built in the first time. It happens in 2021.2.5 as well as 2021.2.7. Here is the log https://www.swisstransfer.com/d/f5947a3f-cfd4-4484-8d2f-2f9ea751df18

    Edit: Bug filled (Case 1392959).
     
    Last edited: Jan 6, 2022
  3. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,205
    This looks very interesting.

    How does the dedicated server build handle the Addressable asset system?
    If I'm building and loading addressables locally, does the dedicated server build also strip texture/vertex data from assets built by addressables?

    if not, are there any plans to support that?
     
    Vladnee likes this.
  4. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    829
    I think they answered here already.
     
  5. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    829
    The dedicated server sub targets appear to have their own, separate scripting define symbols list in Player Settings now. However, it seems to ignore those. Builds appear to use the scripting define symbols which are set in the regular standalone build target section of player settings, instead. Are these separate define symbols supposed to work?
     
  6. cristianm_unity

    cristianm_unity

    Unity Technologies

    Joined:
    Oct 16, 2018
    Posts:
    205
    Hi @Claytonious!
    Yes, they are supposed to be independent. However we identified a bug where dedicated server is using some player settings of the standalone platform - including the scripting define symbols.
    It’s expected to be fixed in the next releases.
     
    Claytonious likes this.
  7. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    829
    That will make our builds much more convenient once that is working - thanks!
     
  8. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    829
    Does anyone know when Unity Cloud Build will support specifying this new subtarget in cloud builds?
     
  9. iceb_

    iceb_

    Joined:
    Nov 10, 2015
    Posts:
    94
    Tested 2021.2.8 URP (same with all other versions of 2021.2) yesterday, build times to Windows player builds still super high compared to 2020.3, approximately 500-900% longer than 2020.3. Something to do with the shader stripping process. In 2020.3, it only takes 7 mins, but now in 2021.2 it is much longer.
     
  10. KadirCrossX

    KadirCrossX

    Joined:
    Oct 7, 2018
    Posts:
    3
    It seems that the dedicated server builds (Windows build, haven't tried Linux build yet) compiled using Unity 2021.2.8f1 had all mesh colliders disabled or stripped away, convex or otherwise. Game objects that normally collide with them just simply pass through, and any triggers are not firing. Collision/triggers between box/sphere collider worked fine.
    Mesh collision/triggers still work in editor play mode.

    Edit 1: just did some more debug logging, It seems that mesh colliders in the dedicated server build are indeed enabled and have correct attributes (eg isTrigger, isConvex, etc), but the problem still persists (ie the box/sphere collider game objects still simply go through mesh collider, mesh collider triggers not firing, etc).
     
    Last edited: Jan 29, 2022
  11. ArjanBroosSioux

    ArjanBroosSioux

    Joined:
    Jun 1, 2021
    Posts:
    14
    @Claytonious Could you share how you worked around this issue, for now?
     
    Last edited: Jan 31, 2022
  12. cristianm_unity

    cristianm_unity

    Unity Technologies

    Joined:
    Oct 16, 2018
    Posts:
    205
    @KadirCrossX, thanks for sharing that issue details, we are looking at it, but could you please report a bug and let me know the case number so we can properly track it? Cheers!
     
  13. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    829
    In case it is helpful to diagnose this more, we have not had this problem - physics is working fine in our dedicated server target builds so far. @KadirCrossX maybe we could compare a few settings to help find out why that's happening in your builds.

    EDIT: Actually, it looks like our dedicated server builds *do* have the same problem that @KadirCrossX has described here, after all. The fact that primitive colliders (box and sphere, for example) were still working masked the problem for a while, but mesh colliders are not working in the dedicated server builds just as he described above.

    @cristianm_unity do you know if there is a workaround for this in the current releases?

    EDIT2: It looks like manually marking the meshes in question as read/write in their importer settings works for now as a workaround. @KadirCrossX , that might be a useful workaround for you, too, until this is fixed.
     
    Last edited: Feb 4, 2022
    KadirZaini likes this.
  14. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    829
    Very simply: our build script for dedicated server sets its own scripting define symbols before building, then resets them back after the build.
     
  15. KadirCrossX

    KadirCrossX

    Joined:
    Oct 7, 2018
    Posts:
    3
    Alright, I've reported it. The case number is: 1399961

    Huh, interesting. On our side, the bug happened even with the default player setting.

    Here's imgur link containing a gif visualizing the problem and an image of the setting used to generate build: link
     
  16. ArjanBroosSioux

    ArjanBroosSioux

    Joined:
    Jun 1, 2021
    Posts:
    14
    @cristianm_unity Could you share a bug ticket, so we can keep an eye on when it is fixed?
     
  17. KadirCrossX

    KadirCrossX

    Joined:
    Oct 7, 2018
    Posts:
    3
    U̶p̶d̶a̶t̶e̶:̶ ̶N̶o̶t̶ ̶s̶u̶r̶e̶ ̶i̶f̶ ̶t̶h̶i̶s̶ ̶i̶s̶ ̶r̶e̶l̶a̶t̶e̶d̶,̶ ̶b̶u̶t̶ ̶w̶h̶e̶n̶ ̶t̶r̶y̶i̶n̶g̶ ̶t̶o̶ ̶r̶u̶n̶ ̶t̶h̶e̶ ̶d̶e̶d̶i̶c̶a̶t̶e̶d̶ ̶s̶e̶r̶v̶e̶r̶ ̶b̶u̶i̶l̶d̶ ̶w̶i̶t̶h̶ ̶A̶m̶a̶z̶o̶n̶ ̶G̶a̶m̶e̶L̶i̶f̶t̶,̶ ̶i̶t̶ ̶a̶f̶f̶e̶c̶t̶e̶d̶ ̶M̶i̶c̶o̶s̶m̶o̶'̶s̶ ̶S̶e̶n̶s̶o̶r̶T̶o̶o̶l̶k̶i̶t̶ ̶(̶S̶e̶n̶s̶o̶r̶T̶o̶o̶l̶k̶i̶t̶ ̶(̶m̶i̶c̶o̶s̶m̶o̶.̶c̶o̶m̶)̶)̶,̶ ̶a̶s̶ ̶i̶t̶ ̶u̶s̶e̶s̶ ̶m̶e̶s̶h̶ ̶c̶o̶l̶l̶i̶d̶e̶r̶s̶ ̶f̶o̶r̶ ̶t̶h̶e̶ ̶s̶e̶n̶s̶o̶r̶s̶.̶ ̶T̶h̶e̶ ̶s̶e̶n̶s̶o̶r̶s̶ ̶a̶r̶e̶ ̶u̶s̶e̶d̶ ̶f̶o̶r̶ ̶o̶u̶r̶ ̶A̶I̶s̶.̶
    Screenshot 2022-02-08 105514.jpg

    H̶o̶w̶e̶v̶e̶r̶,̶ ̶w̶h̶e̶n̶ ̶r̶u̶n̶ ̶n̶o̶r̶m̶a̶l̶l̶y̶,̶ ̶i̶e̶ ̶d̶i̶r̶e̶c̶t̶l̶y̶ ̶u̶s̶i̶n̶g̶ ̶M̶i̶r̶r̶o̶r̶'̶s̶ ̶s̶t̶a̶r̶t̶ ̶s̶e̶r̶v̶e̶r̶,̶ ̶s̶k̶i̶p̶p̶i̶n̶g̶ ̶G̶a̶m̶e̶L̶i̶f̶t̶ ̶p̶r̶o̶c̶e̶s̶s̶e̶s̶,̶ ̶t̶h̶e̶ ̶s̶e̶n̶s̶o̶r̶s̶ ̶a̶r̶e̶ ̶s̶t̶i̶l̶l̶ ̶a̶b̶l̶e̶ ̶t̶o̶ ̶d̶e̶t̶e̶c̶t̶ ̶b̶o̶x̶ ̶c̶o̶l̶l̶i̶d̶e̶r̶s̶,̶ ̶b̶u̶t̶ ̶n̶o̶t̶ ̶m̶e̶s̶h̶ ̶c̶o̶l̶l̶i̶d̶e̶r̶s̶ ̶d̶e̶s̶p̶i̶t̶e̶ ̶t̶h̶e̶ ̶s̶e̶n̶s̶o̶r̶s̶ ̶i̶t̶s̶e̶l̶f̶ ̶u̶s̶i̶n̶g̶ ̶m̶e̶s̶h̶ ̶c̶o̶l̶l̶i̶d̶e̶r̶s̶.̶

    Edit 1: I added 3 seconds delay before creating AIs using Coroutine, and suddenly it worked again. Huh. So yeah, disregard the Amazon GameLift related bug.

     
    Last edited: Feb 9, 2022
  18. hyouuu

    hyouuu

    Joined:
    Nov 26, 2020
    Posts:
    42
    This is our script to build Linux server:
    Code (CSharp):
    1.  
    2. public static void BuildLinux()
    3. {
    4.     BuildPlayerOptions options = new BuildPlayerOptions();
    5.     options.scenes = new[] {"Assets/_Scenes/MainScene.unity"};
    6.     options.locationPathName = "Build/Server/linux/banban-server";
    7.     options.target = BuildTarget.StandaloneLinux64;
    8.     options.options = BuildOptions.EnableHeadlessMode;
    9.     BuildReport report = BuildPipeline.BuildPlayer(options);
    10.     BuildSummary summary = report.summary;
    11.     switch (summary.result)
    12.     {
    13.         case BuildResult.Succeeded:
    14.             Debug.Log("Build Linux succeeded with size: " + summary.totalSize + " bytes");
    15.             break;
    16.         case BuildResult.Failed:
    17.             Debug.Log("Build Linux failed");
    18.             break;
    19.         default:
    20.             Debug.Log("Build Linux unexpected result:" + summary.result);
    21.             break;
    22.     }
    23. }
    We're using Mirror and this script worked great on 2021.1.27, but after we upgrade to 2021.2.10, client would stuck when trying to connect to server. We're suspecting the Dedicated Server change caused the problem. Is there something we need to change in this script or somewhere else to get the dedicated server options correct like before?
     
    Warena likes this.
  19. hyouuu

    hyouuu

    Joined:
    Nov 26, 2020
    Posts:
    42
  20. cristianm_unity

    cristianm_unity

    Unity Technologies

    Joined:
    Oct 16, 2018
    Posts:
    205
    @hyouuu, Dedicated Server changes didn't touch anything related to Networking directly, so I suspect the issue might be somewhere else (Like something related to the transport used). Do you think you could create a small reproduction project that we could look at? If so please report a bug with the BugReporter and let me know the case number; I will be happy to have a quick look.

    Cheers!
     
  21. Chimoru

    Chimoru

    Joined:
    May 22, 2015
    Posts:
    4
    @cristianm_unity are NavMeshes currently supported for Dedicated Server builds? From what I can tell, they are not. All the objects in my game which start on a NavMesh return this error when I call SetDestination (see screenshot). Whereas when I target any other build (Mac Standalone, iOS, etc.) the NavMeshes work just fine.
     

    Attached Files:

  22. cristianm_unity

    cristianm_unity

    Unity Technologies

    Joined:
    Oct 16, 2018
    Posts:
    205
    @Chimoru , that sounds like a bug, could you please report it through the bug reporter? and let me know the case number so I can have a look.

    Cheers!
     
  23. Chimoru

    Chimoru

    Joined:
    May 22, 2015
    Posts:
    4
    Hi @cristianm_unity , I reported a bug. Case #1406770. Please take a look as I would like to use the server build for my game server to see if I can reduce overhead.

    Thanks!
     
    UnityGio and cristianm_unity like this.
  24. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    761
    I built a dedicated server, and it seems to still be including a lot of unnecessary stuff. Here is the report from my build:
    Code (CSharp):
    1. Textures               624.8 kb     2.0%
    2. Meshes                 7.9 mb     25.6%
    3. Animations             3.5 mb     11.4%
    4. Sounds                 6.3 mb     20.6%
    5. Shaders                905.2 kb     2.9%
    6. Other Assets           10.4 mb     33.7%
    7. Levels                 0.0 kb     0.0%
    8. Scripts                397.0 kb     1.3%
    9. Included DLLs          0.0 kb     0.0%
    10. File headers           826.4 kb     2.6%
    11. Total User Assets      30.8 mb     100.0%
    12. Complete build size    171.9 mb
    13. Used Assets and files from the Resources folder, sorted by uncompressed size:
    14. 777.3 kb     0.4% Assets/Props Animations/Animations/Idle3.fbx
    15. 502.7 kb     0.3% Assets/Props Animations/Animations/Idle2.fbx
    16. 495.8 kb     0.3% Assets/UI Toolkit/UnityThemes/UnityDefaultRuntimeTheme.tss
    17. 267.2 kb     0.2% Assets/GUI Kit The Stone/Fonts/Changa-Bold SDF.asset
    18. 266.6 kb     0.2% Assets/GUI Kit The Stone/Fonts/Changa-Medium SDF.asset
    19. 249.0 kb     0.1% Assets/MidiPlayer/Resources/SoundfontsDB/GeneralUser GS v1.471/GeneralUser GS v1.471_data.bytes
    20. 234.7 kb     0.1% Assets/Mindblocks/Terrain/structure/Resources/Desert/Hanging Gardens Of Babylon.asset
    21. 229.6 kb     0.1% Resources/unity_builtin_extra
    22. 190.4 kb     0.1% Assets/Mindblocks/Items/Resources/Ores/Diamond/Models/06_Palett.asset
    23. 184.2 kb     0.1% Assets/Mindblocks/Terrain/structure/Resources/Medieval/Castles/Purple Castle.asset
    24. 182.0 kb     0.1% Assets/Mindblocks/Terrain/generator/Resources/town.en.txt
    25. 181.7 kb     0.1% Assets/Mindblocks/Items/Resources/Ores/Diamond/Models/05_Chest.asset
    26. 174.5 kb     0.1% Assets/Props Animations/Animations/Idle.fbx
    27. 171.5 kb     0.1% Assets/Mindblocks/Terrain/structure/Resources/Japan/Castle.asset
    28. 168.7 kb     0.1% Assets/Mindblocks/Mobs/Mobs/Monsters/Dragon/Dragon.fbx
    29. 164.3 kb     0.1% Assets/Mindblocks/Skins/Resources/Cape/Dragon Wings/dragon_wings.fbx

    There are 8 MB in meshes, 3.4 in animations, 600kb in textures, 6.3 MB in sounds, and another MB in fonts. None of this is needed on a server build.

    all my fbx files and textures have read/write turned off.
     
  25. KyleOlsen

    KyleOlsen

    Joined:
    Apr 3, 2012
    Posts:
    237
    Some servers require meshes and animations to still exist (think mesh colliders and most FPS games where animation is required for hit detection). Perhaps additional options can be added to change what exactly gets stripped, but automatically removing meshes and animation would be a mistake, imo.
     
    cristianm_unity and goldbug like this.
  26. killers0992

    killers0992

    Joined:
    Jan 15, 2020
    Posts:
    4
    I tried building dedicated server and loading scenes takes much time idk if its about still existing textures/shaders or what, also while starting dedicated server i have logs about x shader is not supported on that gpu
     
  27. lorddanger

    lorddanger

    Joined:
    Aug 8, 2015
    Posts:
    100
    I am also seeing the same thing
     
  28. KadirZaini

    KadirZaini

    Joined:
    Mar 16, 2022
    Posts:
    1

    Oh my, thanks for the follow up, Ill try to implement the workaround.

    Edit: Marking the meshes as read/write indeed works, wew.
     
    Last edited: Mar 19, 2022
  29. -chris

    -chris

    Joined:
    Mar 1, 2012
    Posts:
    98
    Some observations when building a Dedicated Server with Unity 2021.2.16:

    1. Files are still included that aren't needed

    - SpriteAtlases still get generated and packed – waste of time and space.
    - PostProcessing shader variants are still compiled – waste of time and space.

    From what I can tell, audio files, font files... things that are referenced in my scenes are included, even though they serve no purpose on a headless server.

    Why are such file types included, and is there a way to not include them?

    My client and server builds generally share a mix of the same scene types, though I try to put my music in a separate scene. But things like fonts for the UI, small audio clips, and sprites are still "referenced" even though they are not needed on the server.

    A lot of cruft seems to get shoved into sharedassets0.assets.

    For my SpriteAtlases, I have to manually click the checkmarks to not "Include in Build" for every build.

    Is there a way to get rid of visual / audio / media / material / texture files? Like, some sort of extra Options flags to pass in to specify what file types to remove?

    2. Scripting Define Symbols aren't scriptable
    Because there is no BuildTargetGroup for "Dedicated Server", PlayerSettings.SetScriptingDefineSymbolsForGroup only affects the regular "Windows, Mac, Linux settings" standalone player Scripting Define Symbols.

    The "Dedicated Server settings" server Scripting Define Symbols seem unable to be modified via scripting...? Have to manually modify them using the Project Settings > Player GUI.
     
    c8theino likes this.
  30. -chris

    -chris

    Joined:
    Mar 1, 2012
    Posts:
    98
    Also, this is ripe:

    3. PlayerSettings.SetScriptingDefineSymbolsForGroup does not work if "Dedicated Server" is the platform

    Can't use my scripts to set Scripting Define Symbols. Have to manually open the Build Settings tab, click on "Windows, Mac, Linux", click "Switch Platform", then can apply the Scripting Define Symbols.

    This is a known issue for 2021.2, yet it's only fixed in 2022.1?!

    Can this please be fixed for 2021.2.x?
     
  31. onomei

    onomei

    Joined:
    Feb 15, 2018
    Posts:
    2
    Since updating to 2021.2.17 (from 2021.2.2) I'm no longer able to build for any Dedicated Server targets - in editor I see the following in Build Settings.

    upload_2022-3-28_18-38-24.png

    CI build also fails with "Error building Player: Currently selected scripting backend (Mono) is not installed."

    In both cases, all modules have been installed via Unity Hub without error.

    Any idea what's going on here?
     
  32. NuclearCookieTF

    NuclearCookieTF

    Joined:
    Mar 29, 2021
    Posts:
    14
    You can do this using https://docs.unity3d.com/2021.2/Doc...PlayerSettings.SetScriptingDefineSymbols.html
     
  33. NuclearCookieTF

    NuclearCookieTF

    Joined:
    Mar 29, 2021
    Posts:
    14
    Do you have an update on this case please?
    I know I can enable read/write but I don't want read/write to be enabled on the clients. Is there an elegant solution to toggle read/write on objects with meshcolliders only for dedicated server target?
    This seems like something that should be handled by Unity.

    Additionally, shouldn't this be handled by https://docs.unity3d.com/ScriptReference/PlayerSettings-bakeCollisionMeshes.html ?
     
    Last edited: Mar 29, 2022
  34. NuclearCookieTF

    NuclearCookieTF

    Joined:
    Mar 29, 2021
    Posts:
    14
  35. ArjanBroosSioux

    ArjanBroosSioux

    Joined:
    Jun 1, 2021
    Posts:
    14
    @cristianm_unity: Any update on this? Still seeing it in the 2021 LTS version.

    The documentation mentions that scripting symbols won't switch when changing build targets, but fails to explain how to make sure the scripting symbols switch when building from script.
     
  36. MartinTwinDrums

    MartinTwinDrums

    Joined:
    Jan 18, 2021
    Posts:
    14
    I am having the same issue, also with 2021.2.17/18/19 and also for the Mac OS X dedicated server build (and yes, they are installed)

    It would be great if we could get some feedback on this, since it is blocking us in building dedicated servers.
     
  37. MartinTwinDrums

    MartinTwinDrums

    Joined:
    Jan 18, 2021
    Posts:
    14
    I also tested 2021.3.0f1 with similar results.

    "Error building Player: Currently selected scripting backend (Mono) is not installed."

    upload_2022-4-14_14-39-13.png
     
  38. -chris

    -chris

    Joined:
    Mar 1, 2012
    Posts:
    98
    Just tested upgrading from 2021.2.16 to 2021.2.19.

    Have to go File > Build Settings > click Dedicated Server > click Switch Platform.

    Switching platform via scripting does not work; builds fail with error:
    But after clicking the "Switch Platform" button, building via scripting then works.
     
    Zer0Morph likes this.
  39. cristianm_unity

    cristianm_unity

    Unity Technologies

    Joined:
    Oct 16, 2018
    Posts:
    205
    It has been fixed, but there is still what you mention about scripting symbols taking effect in the next reload. The best way to solve it is to switch to the target you want to build previously. So if you do this before building it should work:

    Code (CSharp):
    1. EditorUserBuildSettings.SwitchActiveBuildTarget(NamedBuildTarget.Server, buildTarget);
    If it doesn't please share some details/code so we can take a closer look.

    Cheers!
     
  40. cristianm_unity

    cristianm_unity

    Unity Technologies

    Joined:
    Oct 16, 2018
    Posts:
    205
    Hey @MartinTwinDrums , @-chris, I just tried switching and building build linux dedicated server in mac (installing only linux dedicated server module).

    It seems to be working properly for me, so I must be missing something. If you could share some detailed steps I could follow to try to reproduce it, I'll be happy to take a look.

    Cheers!
     
  41. -chris

    -chris

    Joined:
    Mar 1, 2012
    Posts:
    98
    @cristianm_unity Thanks for sharing. Just done some testing.

    This post was going to be about how there's no Server property in BuildTarget nor BuildTargetGroup for use when calling EditorUserBuildSettings.SwitchActiveBuildTarget.

    But using your suggestion, the following overload works successfully:
    Code (CSharp):
    1. EditorUserBuildSettings.SwitchActiveBuildTarget(
    2.     NamedBuildTarget namedBuildTarget,
    3.     BuildTarget buildTarget
    4. );
    But why is this not in the SwitchActiveBuildTarget documentation? The only valid overload (supposedly) is to pass in a BuildTargetGroup, not a NamedBuildTarget.

    Hidden knowledge coming out? o_O

    I've adjusted my code to make switching work via scripting now; no longer have to click the Build Settings > Switch Platform button. Doing this also allows Scripting Define Symbols to be set as intended:
    Code (CSharp):
    1. static void SetBuildTargetAndSymbols (
    2.     BuildTargetGroup buildTargetGroup,
    3.     BuildTarget buildTarget,
    4.     StandaloneBuildSubtarget standaloneBuildSubtarget,
    5.     string scriptingDefineSymbols
    6. ) {
    7.     NamedBuildTarget namedBuildTarget;
    8.  
    9.     if (standaloneBuildSubtarget == StandaloneBuildSubtarget.Server) {
    10.         namedBuildTarget = NamedBuildTarget.Server;
    11.     }
    12.     else {
    13.         switch (buildTargetGroup) {
    14.  
    15.             case BuildTargetGroup.Standalone:
    16.                 namedBuildTarget = NamedBuildTarget.Standalone;
    17.                 break;
    18.  
    19.             case BuildTargetGroup.Android:
    20.                 namedBuildTarget = NamedBuildTarget.Android;
    21.                 break;
    22.  
    23.             case BuildTargetGroup.iOS:
    24.                 namedBuildTarget = NamedBuildTarget.iOS;
    25.                 break;
    26.  
    27.             case BuildTargetGroup.Switch:
    28.                 namedBuildTarget = NamedBuildTarget.NintendoSwitch;
    29.                 break;
    30.  
    31.             default:
    32.                 Debug.LogError($"No case for {buildTargetGroup}");
    33.                 return;
    34.  
    35.         }
    36.     }
    37.  
    38.     EditorUserBuildSettings.SwitchActiveBuildTarget(namedBuildTarget, buildTarget);
    39.  
    40.     PlayerSettings.SetScriptingDefineSymbolsForGroup(buildTargetGroup, scriptingDefineSymbols);
    41. }
    Would prefer to pass in an enum rather than a struct, but this does the trick for now. Cheers.
     
    cristianm_unity likes this.
  42. cristianm_unity

    cristianm_unity

    Unity Technologies

    Joined:
    Oct 16, 2018
    Posts:
    205
    @-chris thanks for checking it! Well, yes, it seems most issues for building are due to the confusion caused by the PlayerSettings and EditorUserBuildSettings API still receiving a BuildTargetGroup (And its documentation).
    Working on improving it.

    NamedBuildTarget.FromBuildTargetGroup(buildTargetGroup) ;)
     
    -chris likes this.
  43. MartinTwinDrums

    MartinTwinDrums

    Joined:
    Jan 18, 2021
    Posts:
    14
    Thanks for getting back. I tracked down the issue: it is a Unity (Hub) install issue. Unity Hub claims that certain modules are installed, while they are not actually present in the directories. I am currently investigating how to circumvent this issue. It would be great if there would be an option to uninstall a module after it had been installed. Currently my only option is to uninstall the version completely.
     
    cristianm_unity likes this.
  44. TheGamery

    TheGamery

    Joined:
    Oct 14, 2013
    Posts:
    88
    Tried Dedicated Server with MySQL Connector and I get NotSupported errors, works fine in Windows Standalone though.

    Using 2021.3.1f1.
     
  45. Levitas

    Levitas

    Joined:
    Mar 17, 2015
    Posts:
    7
  46. jesusluvsyooh

    jesusluvsyooh

    Joined:
    Jan 10, 2012
    Posts:
    372
  47. fgsoftwarestudio

    fgsoftwarestudio

    Joined:
    Jul 23, 2020
    Posts:
    1
  48. ArjanBroosSioux

    ArjanBroosSioux

    Joined:
    Jun 1, 2021
    Posts:
    14
    Hi, SwitchActiveBuildTarget is not available in batch mode: https://docs.unity3d.com/ScriptReference/EditorUserBuildSettings.SwitchActiveBuildTarget.html.
    "Note: This method is not available when running the Editor in batch mode."

    I created a bug report with a minimal reproduction scenario here:
    https://fogbugz.unity3d.com/default.asp?1422125_kfu6g1t1tda28q1d (Case 1422125)
     
  49. Ashkan_gc

    Ashkan_gc

    Joined:
    Aug 12, 2009
    Posts:
    1,089
    I'm receiving an error on my dedicated server on linux on aws which it cannot connect to WSS using websocket sharp which worked perfectly in 2020.3 server builds for the same platform.

    it still works with the windows clients.

    Is anybody else getting this?

    On dedicated server linux in 2021.3 TLS handshake fails with a message saying chain is empty
     
  50. Oniros88

    Oniros88

    Joined:
    Nov 15, 2014
    Posts:
    123
    Is there a way to ignore all image files and not just the ones with read/write disabled? I mean as a sort of optional feature if you are sure you will never use any texture in server even if you read texture data in clients.
     
    dev2X likes this.