Unity Template Issues
Common hurdles when working with the Unity template.
The "Managers" are missing
The SIMPLE Unity template relies on a Managers object being present in the scene, containing the ConnectionManager and SimulationManager components.
Symptoms:
NullReferenceExceptionwhen accessingSimulationManager.Instance.- No connection attempts logged in the Unity console.
Solution: Always start your scene from one of the Scene Templates provided in the template, or drag the Connection Manager and Game Manager prefabs into your hierarchy.
Prefabs not appearing (Pink/Missing)
If GAMA is sending data but objects don't appear in Unity, or appear as pink boxes:
- Resources Folder: Ensure your prefabs are located inside a folder named
Resources. Unity'sResources.Load()(used internally by the template) can only find assets in these specific folders. - Prefab Name Mismatch: The
prefabPathparameter in GAML'sprefab_aspectmust exactly match the path relative to theResourcesfolder (e.g.,"Prefabs/Car").
Jittery Movement or Floating Objects
If agents appear to jump around or are at the wrong height:
- Coordinate Precision: Ensure the
precisionvariable in GAMA matches the one expected by Unity. If GAMA sends raw high-precision integers but Unity doesn't divide them correctly, objects will appear millions of meters away. - Y-Offset: Adjust the
y_offsetin yourunity_aspect(GAML) to ensure agents are properly grounded on your Unity terrain.
Editor & Build Environment
"Android SDK/NDK path not found"
If Unity complains about missing Android tools:
- Go to Edit > Preferences > External Tools.
- Scroll to the Android section.
- Uncheck and then Recheck the boxes for JDK, SDK, and NDK. This forces Unity to refresh its internal paths.
VS Code IntelliSense not working
- Go to Edit > Preferences > External Tools.
- Set "External Script Editor" to Visual Studio Code.
- Click Regenerate project files.
Lighting Data Warning
If you see a warning about incompatible lighting data:
- Go to Window > Rendering > Lighting.
- Click Generate Lighting at the bottom of the window.
Interactions & UI
Raycast doesn't hit agents
If you point at an agent with your controller but no hover/select event fires:
- Collider: Check that the agent's Unity prefab (or the generated mesh) has a Collider component.
- Interaction Layer: Ensure the object is not on a layer that the XR Ray Interactor is configured to ignore.
unity_interaction: Verify thatis_interactableis set totruein your GAMLunity_interactiondefinition.
UI Buttons don't respond to clicks
If you can see the UI but cannot interact with it:
- EventSystem: Ensure there is an
EventSystemobject in your scene with an XR UI Input Module. - Canvas: The Canvas must have a Tracked Device Graphic Raycaster component to respond to VR controllers.
Windows build crashes with DllNotFoundException: websocket-sharp
The Unity template requires Assets/Plugins/websocket-sharp.dll for Windows builds. This file is included in the repository but can be lost when copying the project manually (e.g. when extracting the release ZIP without preserving the full directory tree).
Verify that Assets/Plugins/websocket-sharp.dll exists in your project before building. If it is missing, re-extract the template ZIP from the GitHub Release and copy the file back.