MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

Undefined behaviour of cursor when SimpleSinglePointerSelector isn't used

Open GAnatoliy opened this issue 9 years ago • 1 comments

Hello,

I am converting project from unity 5.6.x to 2017.x There are lot changes in holotoolkit and some of them don't have up to date documentation, e.g. using of FocusManager and input system in general. (or I didn't find it).

There is issue when cursor don't have LoadPointer and FocusManager has 0 points and autoRegisterGazePointerIfNoPointersRegistered is true. Such configuration in the InputManagerTest scene.

Cursor method try to use pointer from FocusManager at the "Start" function and FocusManager generates default point at the "Start" function. Since order of the start function isn't defined such configuration could stop work at some point (in my case it worked fine and after some changes in scene stops). Probably would be useful to write some message to console as info or warning in such case (if fixing such issue isn't in priority).

File Cursor.cs Method private void TryLoadPointerIfNeeded() (it is called from Start)

            else if (FocusManager.IsInitialized)
            {
                // For backward-compatibility, if a pointer wasn't specified, but there's exactly one
                // pointer currently registered with FocusManager, we use it.
                IPointingSource pointingSource;
                if (FocusManager.Instance.TryGetSinglePointer(out pointingSource))
                {
                    Pointer = pointingSource;
                }
            }

File FocusManager.cs

private void Start()

if ((pointers.Count == 0) && autoRegisterGazePointerIfNoPointersRegistered && GazeManager.IsInitialized)
{
    RegisterPointer(GazeManager.Instance);
}

Thanks.

GAnatoliy avatar Nov 02 '17 09:11 GAnatoliy

Closing issues older than 180 days. If this is still an issue, please reactivate with recent information.

wiwei avatar Apr 11 '19 20:04 wiwei