Unity

Unity #

This article will take you through installing Unity Hub, the Unity Editor, and ALCOM (the FOSS alternative to VRChat Creator Companion).

Most info on this page was written with VRChat in mind, but a lot of it also applies to ChilloutVR. Assume it’s talking about VRChat unless otherwise specified.

Set up Unity Hub #

Choose a method to install Unity Hub. Once installed, move on to the next section.

Install and run Unity Hub from Flathub. This Flatpak typically ships an outdated version, behind all other methods, but seems to be easier to configure.

Unity Hub from AppImage #

You can also download the Unity Hub AppImage, but it may be less reliable. Logging in is broken on some systems. Also, you may need to install cpio from your distro’s repos in order to install the editor components (The AppImage erroneously doesn’t include it). To check if it’s installed, run which cpio in a terminal.

If the Unity Hub AppImage claims it needs an update, performing the self-update may corrupt the AppImage. In this case it may be better to exit Unity Hub and redownload the AppImage from the above URL.

Unity Hub for officially-supported distros #

If you use Ubuntu, Debian, RHEL, or Fedora, installing Unity Hub from their official repos might work best. See their page Install the Unity Hub on Linux for more info.

Unity Hub from Arch Linux AUR #

If you use Arch Linux, use yay or paru or whatever to install the AUR package unityhub. Read these comments, too.

Without Unity Hub #

If you really want to avoid Unity Hub, there are other ways to get the editor version you need. Please note that, while avoiding Unity Hub is appealing, this method is harder. Also, without Unity Hub available, ALCOM won’t be able to migrate projects (from e.g. 2019 to 2022).

I haven’t personally tested a Hub-less installation, but others in the community report success.

Pick one of the below methods to install the Unity Editor and its modules directly. After installation, you must manually activate it with a license. You can follow the instructions on mob-sakai/unity-activate on GitHub.

Once completed, you can skip right to the ALCOM step. Make sure to manually add this Unity installation in ALCOM settings.

i. With Download Assistant #

Here is Unity’s download archive. Select the correct Unity version (currently VRChat recommends creators use 2022.3.22f1) and click “See all”, which will take you to this page: Unity 2022.3.22f1. On this page, under “Manual installs”, expand “Other installs” and get “Download Assistant (Linux)”. The Download Assistant is an install wizard GUI, much more lightweight than Unity Hub. It’s just an executable binary, so open it by double-clicking it in your file manager (e.g. Dolphin).

Install the “Android Build Support” and “Windows Build Support (Mono)” modules.

ii. With Unity Version Manager (uvm) #

unity-version-manager on GitHub

Unity Version Manager is a CLI application to manage Unity versions.

Disclaimers: uvm is a third-party application. AI agents were used in its development. I have not personally tested it. Your milage may vary.

Use Unity Hub to install Unity #

First, take a look at this page from the official VRChat docs about how to install the supported Unity version from Unity Hub. We’ll do something similar.

  1. Open Unity Hub and sign in with your Unity account.
    1. If you have problems logging in, and are using a Google account to sign in, try getting regular Unity credentials instead. Or, install Unity Hub using a different method.
  2. Install 2022.3.22 (VRChat’s current supported Unity version, at the time of writing) by opening your browser to unityhub://2022.3.22f1/887be4894c44.
  3. When prompted, select Android Build Support and Windows Build Support (Mono).
  4. If using Unity Hub Flatpak or AppImage on Arch, install libxml2-legacy to make sure the Unity Editor will properly open outside the sandbox.
  5. If using Unity Hub Flatpak, after installing the Unity Editor, copy the license file from ~/.var/app/com.unity.UnityHub/config/unity3d/Unity/licenses/UnityEntitlementLicense.xml to ~/.config/unity3d/Unity/licenses/ so it will properly recognize your entitlement outside the sandbox. Every few months, you may need to login to Unity Hub and copy the license file out again.

ALCOM #

ALCOM (Alternative Creator Companion) is a native FOSS package manager written in Rust. It supports Windows, Mac, and Linux.

  1. Download the AppImage from the latest “gui” release*. Pick the file named alcom-<some version>-x86_64.AppImage.
  2. Run the AppImage by double-clicking it in your file browser.
  3. If it only shows a blank white window, follow the below section to try another way, then come back here.
  4. If using Unity Hub from AppImage, open the settings tab and under Unity Hub Path, point it to your UnityHub.AppImage.
  5. Optional: In ALCOM settings, edit the the default Unity command-line arguments, and add -force-vulkan. Using Vulkan instead of OpenGL improves performance and stability for many users, but Nvidia users may need additional args alongside this one.
  6. Create a new project and open it.
  7. Go to VRChat SDK -> Show Control Panel and dock it to the main window.
  8. It may open windows partially offscreen. If this happens, see this section below.

Now you should be able to create and upload avatars and worlds like you normally would.

ALCOM white window issue #

The AppImage for ALCOM may only show a blank white window, depending on your distro (issue #1694). If you’re affected by this bug, you can’t use the ALCOM AppImage; you’ll have to install it another way:

  • If on Arch, install it from AUR (alcom or alcom-bin).
  • If using Debian or Ubuntu, install the .deb.
  • If using Fedora or OpenSUSE, install the .rpm.
  • Otherwise, you must build ALCOM from source. Download the source code, install rust stable toolchain, open a terminal to the vrc-get-gui subdirectory, and follow the compile instructions on the vrc-get-gui readme.

World & Avatar SDK #

Out of the box, Build & Test doesn’t work, for both Avatars and Worlds. Thankfully, we maintain Linux-specific patches, which you can install with ALCOM like any other VCC package.

Note: Try to keep your VRChat SDK up-to-date for best results.

⚠️ Warning: This modifies the VRChat SDK using Harmony to properly work on Linux.
This is directly against the VRChat Terms of Service.

These patches for both the Worlds and Avatars SDK are available through this LinuxVRChatSDKPatch VCC page, or the source on GitHub.

Troubleshooting #

Unable to activate Unity license #

If you are using a Fedora or RHEL-based distribution, this may be caused by an OpenSSL configuration option.

To verify that this is the problem, check your ~/.config/unity3d/Unity/Unity.Licensing.Client.log. If you see the text Interop+Crypto+OpenSslCryptographicException: error:03000098:digital envelope routines::invalid digest, running the following command as root will re-enable SHA-1 cryptography and resolve the issue:

update-crypto-policies --set DEFAULT:SHA1

For more information, see the RHEL documentation on security hardening.

The NativeArray/NativeList issue #

There were a few releases of Unity Hub that install the editor in a broken state. This would lead to console errors:

Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/NativeList.cs(837,24): error CS7036: There is no argument given that corresponds to the required formal parameter ‘safety’ of ‘NativeArray<T>.ReadOnly.ReadOnly(void*, int, ref AtomicSafetyHandle)’

This was broken around Unity Hub v3.15.2 and should be fixed by v3.15.3. Upgrade Unity Hub if necessary. You may need to uninstall and reinstall the Unity Editor and the Windows and Android Build Support modules. You do not need to switch to a different version number of the Unity Editor, just Unity Hub. The Flatpak method of Unity Hub was never affected by this; it dodged the issue just by virtue of being outdated.

More info here: Unity Editor does not recognize installed plaforms - Unity Engine - Unity Discussions

Shaders fail to include some .cginc files #

This can happen with Poiyomi. It’s caused by case-sensitivity. You may need to edit the shader files directly. Open them in any text editor, and correct the casing of filenames.

Editor windows appear partially offscreen #

Unity may open undocked panel windows (such as color pickers and unitypackage import dialogs) partially offscreen.

Some workarounds:

  • For KDE, hold the Meta (AKA Super, AKA WinKey) key and click anywhere in the window to drag it back onscreen.
  • Alt-Tab to the specific window, then press Meta-Right to snap the window to the right side of the screen.
  • For KDE, press ALT+F3 -> More Actions -> Move.

Can’t drag-and-drop files from external programs #

Rather than using Assets -> Import New Asset or Import Package, it’s normally possible to drag-and-drop a unitypackage or other asset from a file browser directly into Unity’s Project pane, where it will be copied to the Assets folder.

However, if your file browser is running on Wayland, this will show “Failed copying file” errors.

As a workaround, launch your file browser in Xwayland mode. Unity will accept the file as it should.

WAYLAND_DISPLAY="" dolphin

When Unity is opened via ALCOM, it crashes when dragging a hierarchy object #

Note: If you are on Nvidia, see the Crashing frequently with Nvidia section first.

An ALCOM-launched instance of Unity can crash after trying to drag-and-drop an item (within Unity, ie. not external programs).

This issue #1346 was fixed by ALCOM v0.1.14, so just update.

Analysis: ALCOM has a different environment than the rest of your system, mostly by virtue of being an AppImage. This means the Unity subprocess that it spawns was implicitly inheriting its crummy vars. Unfun fact: This environment inheritance causes several other problems (such as ignoring the user’s GTK theme for menubars and context menus, especially on a KDE system), but I’m not sure the cleanest way to unset those vars yet. A wrapper script around the Unity binary?

VRCFury builds lock up the editor #

Maybe due to the windows offscreen issue mentioned above, when starting build or play mode, the VRCFury progress window may initially be invisible, or pop underneath, which gives the appearance that the build isn’t doing anything and has locked up. Use the “Alt-tab to the specific window then Meta-Right” trick to get the VRCFury progress window to appear onscreen again. That window may also be solid black, but this doesn’t necessarily mean the build has frozen.

Notes about filesystems #

To store Unity projects, typical filesystems like ext4 and btrfs are ok choices.

The best choice in my opinion is NTFS, as it works around case-sensitivity ignorance in certain tools and assets, and is accessible when dual-booting with Windows. The Unity Editor itself should still be installed on a typical filesystem.

Here is an example of a bad filesystem for projects - exFAT:

A dialog may appear upon trying to build an avatar, where none of the buttons are helpful:

Moving Temp/unitystream.unity3d to /tmp/DefaultCompany/Some Avatar Project/prefab-id-v1_avtr_00000000-0000-0000-0000-000000000000_0000000000.prefab.unity3d:

Force Quit | Try Again | Cancel

This seems to happen consistently if the projects are stored on an exFAT partition. Consider storing projects on NTFS.

Built avatar appears non-stereoscopic to me and everyone else #

Ensure the filesystem your project is on has not been mounted with noexec.

With noexec, the shader compilation plugin from VRCSDK will fail with a warning:

Plugins: Couldn’t open /run/media/blahblahblah/MyProject/Packages/com.vrchat.base/Editor/VRCSDK/ShaderCompilerPlugin/Plugins/Linux/x86_64/libvrc_shader_compiler_plugin.so, error: […]: failed to map segment from shared object

Even though the plugin fails to load, the avatar will upload anyway, without including the Double Wide Rendering shader variants necessary for VR.

The noexec mount option may also contribute to other issues such as being unable to run any binaries from inside the project, such as avatar patchers.

Crashing frequently with Nvidia #

On some systems with an Nvidia GPU, the Unity Editor may crash frequently from common actions like importing a unitypackage, dragging a file, or using the color picker.

These crashes can vary depending on what graphics API the editor is configured to use in the Player Settings page: OpenGL or Vulkan. You can tell which is active by reading the title bar.

If you use ALCOM to launch your projects: Open ALCOM, go to the “Default Unity Command-line Arguments” setting on the Settings page. Click “Edit”, “Customize”, “Reset”, “+”, then type in one or both of these into the box:

  1. -force-vulkan - Make the Editor use Vulkan for rendering. Normally the graphics API depends on Player Settings.
  2. -force-vulkan-layers - Enables the Vulkan validation layer.
  3. -force-gfx-direct - Force single threaded rendering.

Then click Save. You may have to try different combinations. Start with trying the 1st and the 3rd.

If you use Unity Hub to launch your projects: Open Unity Hub, click the ... icon to the right of your project, then click “Add command line arguments”, and add the argument(s).

See the discussion thread.

Unity 2021 Crashing #

Note: This section is specific to ChilloutVR.

If you are experiencing crashes or hangs with Unity 2021.3.x on Linux, follow these steps to resolve the issue:

  1. Ensure you have installed the correct version of Unity along with both Windows and Linux build support.

  2. Navigate to the Unity editor installation directory:

    cd ~/Unity/Hub/Editor/2021.3.xxxx/Editor/Data
    
  3. Rename the bee_backend file to bee_backend.bin by running:

    mv bee_backend bee_backend.bin
    
  4. Create a new text file named bee_backend in the same directory:

    touch bee_backend
    
  5. Mark the new bee_backend file as executable:

    chmod 755 bee_backend
    
  6. Open the bee_backend file in a text editor and add the following script:

    #!/bin/bash
    
    args=("$@")
    for ((i=0; i<"${#args[@]}"; ++i))
    do
        case ${args[i]} in
            --stdin-canary)
                unset args[i];
                break;;
        esac
    done
    ${0}.bin "${args[@]}"