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

Question Disabling/enabling XR Grab Interactable

Discussion in 'XR Interaction Toolkit and Input' started by datagreed, Oct 10, 2020.

  1. datagreed

    datagreed

    Joined:
    Sep 17, 2018
    Posts:
    42
    I am trying to let player drag dead enemy bodies with XR Grab Interactable. The problem I facing is that I don't see any way to disable the component when the enemy is alive so the player won't be able to drag him. I want this component to be enabled only when the enemy is dead. Is there any way to do this?
     
  2. yarsrvenge

    yarsrvenge

    Joined:
    Jun 25, 2019
    Posts:
    87
    If you just set the interaction layer to nothing when you dont want it active that will work.. Then change the interaction layer on XRGrabInteractible to what it should be when the mob is dead.
     
  3. datagreed

    datagreed

    Joined:
    Sep 17, 2018
    Posts:
    42
    That's a great idea, thanks! I will give it a try.