question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VRTK_InteractGrab Precognition Bug/Fix

See original GitHub issue

In VRTK_InteractGrab::Update() the grabPrecognitionTimer continuously grabs until the timer ends. If you grab and release before the timer ends however, it will not let go and the object will be stuck to your hand.

Proposed Solution: Disable the timer after we’ve successfully grabbed an object.

Change:

if (grabPrecognitionTimer > 0)
            {
                grabPrecognitionTimer--;
                if (GetGrabbableObject() != null)
                {
                    AttemptGrabObject();
                }
            }

To:

if (grabPrecognitionTimer > 0)
            {
                grabPrecognitionTimer--;
                if (GetGrabbableObject() != null)
                {
                    AttemptGrabObject();

                    if (GetGrabbedObject() != null)
                    {
                        grabPrecognitionTimer = 0;
                    }
                }
            } 

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
thestonefoxcommented, Aug 4, 2016

Lol I’m a noob I’ll make it timing based too 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

VRTK_InteractGrab
An object can be grabbed if the Controller touches a game object which contains the VRTK_InteractableObject script and has the flag isGrabbable set...
Read more >
VRTK_InteractGrab
Grab Precognition : An amount of time between when the grab button is pressed to when the controller is touching an Interactable Object...
Read more >
VRTK_InteractGrab
The Interact Grab script is attached to a Controller object within the [CameraRig] prefab and the Controller object requires the ; An object...
Read more >
VRTK_InteractableObject
VRTK_BaseGrabAction - A Grab Action mechanic for determining how to manipulate the Interactable Object when grabbed by the secondary interacting object. Script ...
Read more >
VRTK_BaseGrabAttach
Inspector Parameters. Precision Grab: If this is checked then when the Interact Grab grabs the Interactable Object, it will grab it with precision...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found