Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to grab something using the laser pointer beam with VRTK?

Discussion in 'AR/VR (XR) Discussion' started by nsmith1024, Sep 22, 2018.

  1. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    Hello,

    I would like to point the laser beam at an object, press the touch pad to pick it up at the end of the laser beam, The bean should remain at a fixed length at this while while holding the object.

    Then i should be able to walk somewhere and then drop it off when i release the touch pad.

    I cant find any examples of that, all they have is how to do it using the pointer itself by touching the object with the controller.

    But i want to remotely pick up and move object using the laser beam.

    Does anybody know how to do that using VRTK?

    Thanks
     
    ImpossibleRobert likes this.
  2. Tset_Tsyung

    Tset_Tsyung

    Joined:
    Jan 12, 2016
    Posts:
    411
    Hi nsmith,

    Not sure if I'm understanding what your saying... but you could try this (never used VRTK so don't now if you can access the scripts themselves...)

    • When player hits 'grab' button, send out a raycast to get any object that the beam is on.
    • If that object is grabbable you could assign it to the hand.
    • Or did you want the object to stay at the end of the beam until drawn in, pushed out or dropped? If so you'd have to record it's distance and then each frame move it's position to the same distance along the beam...

    Don't know if that's any help... sorry for poor formatting, using phone... lol