Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Question making an object appear in my hand on trigger press

Discussion in 'VR' started by s3lmonella, Apr 25, 2023.

  1. s3lmonella

    s3lmonella

    Joined:
    Mar 23, 2023
    Posts:
    5
    hey so for some reason i cannot find an answer for this anywhere... but hi! im using unity 2021.3.8 and need to implement the ability to 'summon' an object into my hand on the press of the trigger button and it to dissapear when the button is released. i guess kind of like 'replacing' my hands with the objects momentarily like how you can with xr grab interactable but without of actually pointing at an object to grab with. i literally just want them to appear out of nowhere, sorry if my explanations aren't the best ive been up all night trying to get this to work


    im quite new to this, please let me know if you'd like me to elaborate on anything
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,219
    If button pressed, enable or instantiate object as child of the hand
    If unpressed, disable/destroy object
     
    s3lmonella likes this.
  3. s3lmonella

    s3lmonella

    Joined:
    Mar 23, 2023
    Posts:
    5
    thank you! sorry if this is a stupid question but how would i do something like this?
     
  4. s3lmonella

    s3lmonella

    Joined:
    Mar 23, 2023
    Posts:
    5
    okay so i have no clue what i did but its working now! thanks so much for the help again
     
    DevDunk likes this.