Questions and Answers (FAQ) 💡
Last updated
Last updated
Needle Engine 4.x
Go to Project Settings/Needle and click on the login button. Follow the steps and log in to your Needle account. After that you'll see your account information in the Unity project settings window. Select the licensed team from the dropdown.
Needle Engine 3.x
Open Edit/Project Settings/Needle
to get the Needle Engine plugin settings. At the top of the window you'll find fields for entering your license information.
Email
- Enter the email you purchased the license with
Invoice ID
- Enter one of the invoice ids that you received by email
Note: You might need to restart the local webserver to apply the license.
Open Addon Preferences/Needle Engine
to get to the Needle Engine addon settings
Email
- Enter the email you purchased the license with
Invoice ID
- Enter one of the invoice ids that you received by email
Note: You might need to restart the local webserver to apply the license.
You might see a warning in your browser about SSL Security depending on your local configuration.
This is because while the connection is encrypted, by default there's no SSL certificate that the browser can validate.
If that happens: click Advanced
and Proceed to Site
. In Safari, you might need to refresh the page afterwards, because it does not automatically proceed. Now you should see your scene in the browser!
The dialogue should only show up once for the same local server
::: tip Connections are secured, because we're enforcing HTTPS to make sure that WebXR and other modern web APIs work out-of-the-box. Some browsers will still complain that the SSL connection (between your local development server and the local website) can't be automatically trusted, and that you need to manually verify you trust that page. Automatic Page Reload and Websocket connections may also be affected depending on the browser and system settings.
If that happens there's usually an exception either in engine code or your code. Open the dev tools (Ctrl + Shift + I or F12 in Chrome) and check the Console for errors. In some cases, especially when you just updated the Needle Engine package version, this can be fixed by stopping and restarting the local dev server. For that, click on the running progress bar in the bottom right corner of the Editor, and click the little X to cancel the running task. Then, simply press Play again.
This usually happens when you're using custom shaders or materials and their properties don't cleanly translate to known property names for glTF export. You can either make sure you're using glTF-compatible materials and shaders, or mark shaders as "custom" to export them directly.
Read more about recommended glTF workflows:
Read more about custom shaders:
If you are using vite or next.js make sure to add the Needle Engine plugins to your config. Example for vite:
Example for next.js
You can also just declare the missing variables in e.g. your root index.html
in a script tag like so:
Please make sure that sure that you have set Lightmap Encoding to Normal Quality. Go to Edit/Project Settings/Player for changing the setting.
This can have many reasons, but a few common ones are:
too many textures or textures are too large
meshes have too many vertices
meshes have vertex attributes you don't actually need (e.g. have normals and tangents but you're not using them)
objects are disabled and not ignored – disabled objects get exported as well in case you want to turn them on at runtime! Set their Tag to EditorOnly
to completely ignore them for export.
you have multiple GltfObject
components in your scene and they all have EmbedSkybox
enabled (you need to have the skybox only once per scene you export)
For Unity: Make sure that you use the UI/Legacy/Text
component and not the TextMeshPro - Text
component
Your existing C# code will not export as-is, you have to write matching typescript / javascript for it.
Needle uses typescript / javascript for components and generates C# stubs for them.
Components that already have matching JS will show that in the Inspector.
Make sure that your lights are set to "Baked" or "Realtime". "Mixed" is currently not supported.
Lights set to mixed (with lightmapping) do affect objects twice in three.js, since there is currently no way to exclude lightmapped objects from lighting
Light shadow intensity can currently not be changed due to a three.js limitation.
If you use a custom cubemap: You can override the texture import settings of the skybox texture (assigned to your cubemap)
If you use the default skybox: Add a SkyboxExportSettings
component anywhere in your scene to override the default resolution
Please the following points:
Your light has shadows enabled (either Soft Shadow or Hard Shadow)
Your objects are set to "Cast Shadows: On" (see MeshRenderer component)
For directional lights the position of the light is currently important since the shadow camera will be placed where the light is located in the scene.
Ensure your project is set to Linear colorspace.
Deploying on Glitch is a fast way to prototype and might even work for some small productions. The little server there doesn't have the power and bandwidth to host many people in a persistent session.
Make sure to add the WebXR
component somewhere inside your root GltfObject
.
Optionally add a AR Session Root
component on your root GltfObject
or within the child hierarchy to specify placement, scale and orientation for WebXR.
Optionally add a XR Rig
component to control where users start in VR
When creating new scripts in npmdefs in sub-scenes (that is a scene that is exported as a reference from a script in your root export scene) you currently have to re-export the root scene again. This is because the code-gen that is responsible for registering new scripts currently only runs for scenes with a ExportInfo
component. This will be fixed in the future.
The most likely reason is an incorrect installation.
Check the console and the ExportInfo
component for errors or warnings.
If these warnings/errors didn't help, try the following steps in order. Give them some time to complete. Stop once your problem has been resolved. Check the console for warnings and errors.
Install your project by selecting your ExportInfo
component and clicking Install
Run a clean installation by selecting your ExportInfo
component, holding Alt and clicking Clean Install
Try opening your web project directory in a command line tool and follow these steps:
run npm install
and then npm run dev-host
Make sure both the local runtime package (node_modules/@needle-tools/engine
) as well as three.js (node_modules/three
) did install.
You may run npm install
in both of these directories as well.
While generating C# components does technically run with vanilla javascript too we don't recommend it and fully support it since it is more guesswork or simply impossible for the generator to know which C# type to create for your javascript class. Below you find a minimal example on how to generate a Unity Component from javascript if you really want to tho.
On Windows: Make sure you have added toktx to your system environment variables. You may need to restart your computer after adding it to refresh the environment variables. The default install location is C:\Program Files\KTX-Software\bin
Make sure to not create a project on a drive formatted as exFAT because exFAT does not support symlinks, which is required for Needle Engine for Unity prior to version 3.x. You can check the formatting of your drives using the following steps:
Open "System Information" (either windows key and type that or enter "msinfo32" in cmd)
Select Components > Storage > Drives
Select all (Ctrl + A) on the right side of the screen and copy that (Ctrl + C) and paste here (Ctrl + V)
Make sure your project is on a disk that is known to work with node.js. Main reason for failures is that the disk doesn't support symlinks (symbolic links / softlinks), which is a requirement for proper functioning of node.js. NTFS formatting should always work. Known problematic file system formattings are exFAT and FAT32.
To check the format of your drives, you can:
Open "System Information" (either Windows key and type "System Information" or enter msinfo32
in cmd Windows + R)
Select "Components > Storage > Drives"
There, you can see all drives and their formatting listed. Put your projects on a drive that is NTFS formatted.
@
. Expected identifier, string literal, numeric literal or ..."Needle Engine uses typescript decorators for serialization.
To fix this error make sure to enable experimentalDecorators
in your tsconfig.json
You're likely using an x86_64 version of Unity on an (ARM) Apple Silicon processor. Unity 2020.3 is only available for x86_64, later versions also have Apple Silicon versions. Our Unity integration calling npm will thus do so from an x86_64 process, resulting in the x86_64 version of node and vite/esbuild being used. When you afterwards try to run npm commands in the same project from an Apple Silicon app (e.g. VS Code), npm will complain about mismatching architectures with a long error message.
To fix this, use an Apple Silicon version of Unity (2021.1 or later).
You can also temporarily fix it on 2020.3 by deleting the node_modules
folder and running npm install
again from VS Code. You'll have to delete node_modules
again when you switch back to Unity.
This can happen when you have e.g. a SceneSwitcher
(or any other component that loads a scene or asset) and the referenced Asset in Unity contains a GltfObject
that has the same name as your original scene with the SceneSwitcher
. You can double check this in Unity if you get an error that says something like:
To fix this you can:
Remove the GltfObject
in the referenced Prefab or Scene
Rename the GameObject with the component that loads the referenced scenes
Known devices to cause issues:
Lenovo Thinkpad - T495
If you want (or have to) run your AI locally you can use the Needle llms.txt files as context for your local AI (e.g. Ollama):
See for information on how to set up a self-signed certificate for a smoother development experience. :::
If loading time itself is an issue you can try to split up your content into multiple glb files and load them on-demand (this is what we do on our website). For it to work you can put your content into Prefabs or Scenes and reference them from any of your scripts. Please have a look at .
Ensure you're following and read about
The Intensity Multiplier
factor for Skybox in Lighting/Environment
is currently not supported and has no effect in Needle Engine
Also see the docs on .
We're working on other networking ideas, but in the meantime you can host the website somewhere else (with node.js support) or simply remix it to distribute load among multiple servers. You can also host the itself somewhere else where it can scale e.g. Google Cloud.
Make sure you follow the .
Please check that you're not accidentally in the Inspector's Debug
mode – switch back to Normal
:
Make sure to
If this doesn't fix the problem please ask .
Please see the section.
Use a detector to determine if your device supports WebGL 2, it also hints at what could be the cause of your problem, but generally make sure you have updated your browser and drivers. WebGL 1 is not supported.