In this section, we have listed issues you may encounter while developing your application and ways you can work around them.
While building your scene using Canvas, you may encounter the following issue: your objects render correctly in the Scene view, whereas in the Game view they are totally black. This is a known bug of the Unity Editor when using custom shaders on Screen Space - Overlay
Canvas objects.
Here are some threads on it:
- https://answers.unity.com/questions/1618238/ui-image-with-material-works-in-scene-mode-but-bla.html?childToView=1642248#comment-1642248
- https://answers.unity.com/questions/1220236/ui-image-dsiplayed-as-black-when-using-screen-spac.html
Set the Canvas' Render Mode
to Screen Space - Camera
and reference the right Camera in the field Render Camera
, or set the Render Mode
to World Space
.
While building your scene using Canvas, you may encounter the following issue: your canvas objects using NextMind shaders are rendering the stimulation texture abnormally.
This is due to the shaders that aren't properly handling the stimulation texture's triplanar projection on default canvas. There are two ways to work around this issue:
- Set the
Projection
property of the object's material toStandard
orScreen Coordinates
. - Add
Normal
to the CanvasAdditional Shader Channels
property.
After assigning a transparent NextMind shader on a new material, the material becomes fully transparent and/or displays some glitches on the object:
This is caused by a bug in some versions of Unity's ShaderGraph package. This bug is currently being investigated by Unity: https://issuetracker.unity3d.com/issues/hdrp-transparent-shadergraph-isnt-rendering-correctly-when-using-custom-editor-gui
This can be fixed following these few steps:
- Select the Material, then in the Inspector, click on the 3 dots in the top-right corner, then click on Reset. The Material should no longer appear fully transparent.
- Open the ShaderGraph assigned to the Material: click on the 3 dots again and Edit Shader...
- In the Graph Inspector, copy the value of Custom Editor GUI property (you will have to re-enter it in a later step)
- Empty the string from this same property then click on Save Asset in the top-left corner of the ShaderGraph window.
- Go back to the Scene window. Notice that the shader has the correct aspect now.
- Open the shader again, enter the original value in the Custom Editor GUI property, and click on Save Asset.
While using Unity's new input system, you may notice that Focus Simulation
is not working: even if the checkbox is checked on the NeuroManager, clicking on a NeuroTag will not allow you to interact with it.
The focus simulation is currently using Unity's old input system by getting mouse clicks from Input.GetMouseButton
. If you need this feature, your only option is to set the Active Input Handling
to Both
in the player settings:
While using Unity's new input system, you are not able to navigate through the steps.
Regarding the issue happening within SDK's example scenes, you have 2 options:
- Apply the
Both
value onActive Input Handling
in the player settings - Follow this guide to modify the scripts of the SDK (it will be done in further releases) and apply the update proposed by Unity on the EventsSystem's
Standalone Input Module
of the Hub scene:
When entering play mode inside a scene containing a NeuroManager, you may hear the fan turning at full speed until you press Stop. This is often due to the number of FPS reaching too high levels.
You can fix this in two different ways:
-
Application.targetFrameRate (https://docs.unity3d.com/ScriptReference/Application-targetFrameRate.html)
Use this property in the
Start
function of one your scene's MonoBehaviours. You should set the lowest value that is acceptable for you. For example, if you choose a frame rate of 90fps, write it like this :private void Start() { Application.targetFrameRate = 90; }
-
Vertical Synchronisation (https://docs.unity3d.com/Manual/class-QualitySettings.html)
The vertical synchronisation can be set from Edit>Project Settings>Quality. In the Other section, you have to change the
VSync Count
property toEvery V Blank
orEvery Second V Blank
The VSync has to be enabled in the Game view as well:
When running the app, the message below is displayed:
-
This message is mostly displayed when an unsupported architecture is selected in the build settings. Make sure the right platform is selected, check the software compatibility page.
-
It may also be displayed if a SDK's library is not present in your project. In this case, please download & import the SDK again in your project (at least the Plugins folder).
On MacOS, all works well in the Unity editor, but when the application is built, a crash occurs right after it starts.
- Bluetooth usage description: Before building, add a description in Project settings > Player settings > Other > Bluetooth usage description. This will set the message displayed by macOS when asking for Bluetooth permission.
The NeuroTags in the scene remain inactive after pressing play. You notice at least one of these symptoms:
- NeuroTag's gizmos remain red in the Scene view and not declared as Active in NextMind Profiler
- The stimulation is not happening (i.e. the stimulation texture is not switched on/off rapidly)
- NeuroManager:
- make sure a
NeuroManager
is present in your scene - make sure a Camera is set on the NeuroManager's
Tracking Camera
property (The Camera tagged as Main Camera is used if this property is null). - make sure the NeuroManager is declared as
Ready
in the profiler, or by code usingNeuroManager.IsReady()
function.
- make sure a
- Visibility from the Tracking Camera:
- make sure the NeuroTags are inside the Tracking Camera's FOV.
- make sure the object is on a layer visible to the camera (check Camera's
Culling Mask
property)
- NeuroTag:
- make sure NeuroTag'
Stimulation renderers
property is properly set with renderers which should show the stimulation - make sure these renderers have a material using a NextMind shader (may not be needed if you are using a custom stimulation)
- make sure the
Stimulation update type
is set toDefault
if you do not intend on using a custom stimulation - make sure the limitation of 10 active NeuroTags is not already reached. In this case, only the first 10 NeuroTags will be active
- make sure NeuroTag'
When clicking on NeuroTags in Play Mode, nothing happens.
- Usage:
- make sure to hold the mouse button while simulating the focus. NeuroTag's confidence value is not set to 1 directly. It will be smoothly interpolated from the current confidence value to 1.
- NeuroManager:
- make sure the
Simulate Focus
is checked
- make sure the
- NeuroTag:
- make sure the NeuroTag is active (if not, consult dedicated troubleshooting section)
- make sure the Stimulation renderer targeted by the NeuroTag has:
- if it is a Canvas object,
Raycast Target
property checked, and the Canvas has aGraphic Raycaster
component - else a
Collider
orCollider2D
- if it is a Canvas object,
- Project Settings:
- make sure to use the right
Active Input Handling
value (see Unity's new Input System issues section on this page)
- make sure to use the right