Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent behavior when using teleport pointer "Select on Deactivate" #2027

Closed
afonseca08 opened this issue Jun 5, 2019 · 4 comments

Comments

Projects
None yet
3 participants
@afonseca08
Copy link

commented Jun 5, 2019

Environment

  • Source of VRTK (Unity Asset Store or GitHub).
    Github

  • Version of VRTK (Unity Asset Store/GitHub release number) (GitHub master commit hash).
    aa7644c

  • Version of the Unity software (e.g. Unity 2018.3).
    2019.1.0f2

  • Hardware used (e.g. Vive/Oculus).
    Oculus Rift

  • SDK used (e.g. OpenVR/SteamVR/Oculus Utilities).
    OpenVR

Steps to reproduce

  1. Open Farm ExampleScene.
  2. Configure the right teleport pointer, RightCurvedPointer as follows:
    Selection Action: ActivatePointer (BooleanAction)
    Selection Method: Select on Deactivate
  3. Run the sample scene and test teleport with Simulated Camera Rig.
  4. Run the sample scene and test teleport with Oculus VR right controller.
  5. Compare results.

Expected behavior

Behavior is the same in steps 3 and 4. The user is able to teleport by selecting and releasing the teleport control.

Current behavior

Step 3: Clicking the middle mouse button brings up the teleport control, releasing it teleports to the indicated location as expected.

Step 4: Touching the thumbstick on the Oculus controller brings up the teleport control, releasing it does not teleport.

Additional notes:
Discussed with @thestonefox in Slack and it appears to be a race condition. Verified by modifying the ObjectPointer.Internal Actions Activate and SelectOnRelease as follows:
Disabled Activate GameObject
Added to SelectOnRelease a Behaviour Enabled Observer, to observe the SelectOnRelease and enable the Activate GameObject.

With this workaround the behavior was consistent on my machine.

@lachlansleight

This comment has been minimized.

Copy link

commented Jun 6, 2019

Just wanted to add a data-point to this: I have SelectOnRelease working perfectly on the Rift S using the Oculus SDK. However on the Quest I have the same problem as OP - the pointer appears but the teleportation doesn't happen.

Some debug logging revealed that the TransformData being passed to the Teleport function is null, seemingly caused by bool IsActivated on the ObjectPointer being false when its Select method is called.
(as well as activePointsCastData.IsValid being false and HoverTarget being null).

I can confirm that the workaround solves the problem on my machine. Thanks heaps for including it in your Issue @afonseca08 !

@thestonefox

This comment has been minimized.

Copy link
Member

commented Jun 6, 2019

Actually I think this can be fixed by just fixing the prefabs so the workaround is always in place.. I'll take a look

@thestonefox thestonefox added the bug label Jun 6, 2019

@thestonefox

This comment has been minimized.

Copy link
Member

commented Jun 7, 2019

@afonseca08 I still can't recreate the issue locally (the joy of race conditions)

But can you try this PR for me #2029

and see if it fixes the issue for you. I'm hoping this will ensure the order is always the same and would be a nicer solution than having to update the prefab.

@afonseca08

This comment has been minimized.

Copy link
Author

commented Jun 9, 2019

@thestonefox Yes, I just tried it and it fixes the issue. I confirmed it works consistently using the Simulated Camera Rig as well as the Oculus touch controllers in the sample scene. Also confirmed in my own test scene as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.