Get SpatialOS

Sites

Menu

Troubleshooting

Note: We also maintain a known issues page for any open bugs in the SpatialOS GDK for Unity.

Errors


  • Error building player because build target was unsupported
  • When building workers by selecting Build For Cloud > my_worker_name the following error may occur: Error building player because build target was unsupported

    Cause
    You don’t have the correct Unity build support packages installed.

    Fix
    In your Unity Editor:

    • Select SpatialOS > Check build support and check the Console for errors relating to specific build platforms.
      • You need Mac build support if you are developing on a Windows PC and want to share your game with Mac users.
      • You need Windows build support if you are developing on a Mac and want to share your game with Windows PC users.
      • You need Android and/or iOS build support if you are developing for those platforms.
      • Unity gives you build support for your development machine (Windows or Mac) by default.
      • In addition, make sure you have Linux build support enabled. You need Linux build support because all server-workers in a cloud deployment run in a Linux environment.

    Fix this by runing the Unity installer and selecting the appropriate build support options during the installation. See Setup and installing for more information.

    Note: When building your project do not change the UnityGameLogic Cloud Environment field in your BuildConfiguration.asset from Linux. This can cause further build errors.


  • Could not discover location for dotnet.exe
  • Cause
    Either you don’t have the .NET Core SDK (x64) installed or the directory containing the dotnet executable is not in your PATH.

    Fix

    1. Ensure that you have the correct version of .NET Core SDK (x64)(Microsoft documentation) installed. Our supported versions are listed on the setup page).
    2. Ensure that the dotnet executable is added to your PATH environment variable.
    3. Restart your computer after making the above changes.


    Exceptions


  • ‘name-of-a-type’ is an IComponentData, and thus must be blittable
  • Cause

    The struct you defined implements IComponentData and contains non-blittable fields. Types that implement IComponentData may only contain blittable fields.

    The most common causes of this exception are bool and System.Boolean, both of which are not blittable.

    Fix

    Instead of bool and System.Boolean, please use Improbable.Gdk.Core.BlittableBool, a blittable alternative implementation we provide as a workaround for this limitation.


  • Runtime\bcl.exe did not run properly!
  • Cause

    This is a benign exception that is thrown when building a worker while burst compilation is turned on. Your worker was successfully built despite this error. This occurs because Unity’s burst compiler doesn’t yet fully support cross compilation (Windows to Linux, for example).

    Workaround

    To remove the error message, disable burst compilation by unchecking Jobs > Enable Burst Compilation in your Unity Editor.


    Warnings


  • I get several warnings when opening the project for the first time

  • Cause
    These warnings originate from code written by Unity, for example; com.unity.mathematics or com.unity.entities.

    Fix
    These warnings are benign so you can ignore them.


  • I get several warnings when deleting a GameObject or ECS entity that represents a SpatialOS entity
  • Cause
    These warnings occur when a GameObject or ECS entity that represents a SpatialOS entity is deleted before its corresponding SpatialOS entity leaves the worker’s view.

    The GDK expects that a GameObject or ECS entity that represents a SpatialOS entity is only deleted after the SpatialOS entity it represents has left that worker’s view:

    • The GDK automatically deletes an ECS entity when its corresponding SpatialOS entity leaves that worker’s view.
    • For GameObjects, you need to delete the GameObject via your code. The SpatialOS Runtime sends a message to the server-worker when a SpatialOS entity leaves that worker’s view, and the GDK passes this message on to you; it’s your responsibility to act upon these commands at the right time in your code.

    Fix
    When you want to delete a GameObject that represents a SpatialOS entity, send a DeleteEntity world command to delete the entity on the SpatialOS side instead.


    Problems


  • A Reader/Writer or CommandSender/Receiver in my code is null
  • Causes and fixes

    This can be caused by multiple problems. Follow the checklist below to discover the cause and fix:

    • Ensure that your field is declared in a MonoBehaviour. They are not supported in ECS systems.
    • Ensure that the field is decorated with a [Require] attribute (see How to interact with SpatialOS using MonoBehaviours).

      • Ensure that the GameObject containing your MonoBehaviour is associated with a SpatialOS entity. You can verify this by examining whether a LinkedEntityComponent is attached to the GameObject after it is created.
    • Ensure that you only access Requirables in a MonoBehaviour while the MonoBehaviour is enabled. Requirables are supposed to be null while the MonoBehaviour is disabled. Note that certain Unity event methods like OnTriggerEnter or OnCollisionEnter may be invoked, even if a MonoBehaviour is disabled.


  • A MonoBehaviour containing fields using the Require attribute remains disabled when I expect it to be enabled
  • Causes and fixes

    This can be caused by multiple problems. Follow the checklist below to discover the cause and fix:

    • Ensure that GameObjectRepresentationHelper.AddSystems is called when initializing your worker.
      • Ensure that the GameObject containing your MonoBehaviour is associated with a SpatialOS entity. You can verify this by examining whether a LinkedEntityComponent is attached to the GameObject after it is created.
    • Ensure that the requirements for all your fields in your MonoBehaviour are satisfied. You can verify this by examining the SpatialOS entity associated with your GameObject in the SpatialOS Inspector. In the SpatialOS Inspector, ensure that all relevant SpatialOS components are attached to your SpatialOS entity and that read and write access is delegated correctly for your worker.


  • When opening a GDK for Unity solution in Visual Studio 2017, the file has no matching compilation unit
  • Cause
    You don’t have the correct compilation units installed.

    Fix

    Restart your computer. We’ve noticed that this sometimes resolves the issue. If the issue persists:

    1. Follow the Visual Studio installation steps on our setup page.
    2. Restart your computer.

    Search results

    Was this page helpful?

    Thanks for letting us know!

    Thanks for your feedback

    Need more help? Ask on the forums