Forum Discussion

Alchemist11th's avatar
3 years ago

InputOVR Poke Interactor "Active State" and "Interactable Filters"

Hello,

I'm trying to get the poke interactor to only poke buttons when pointer finger is extended (otherwise I have lots of accidental pokes).  I'm using the CustomHandLeft and CustomHandRight prefabs.  I did a little workaround with a script that turns off the "Controller Pointer Pose" component when the hand collider is not active, but I noticed there is an optional "Active State" and "Interactable Filters" inputs in the ControllerPokeInteractor script component.  When I search the script, I don't see anything related to "Active State" or "Interactable Filters" and I can't find anything (or maybe don't understand) in the documentation.  It feels like I made a workaround for something that is already implemented (and probably implemented better than what I did).  Any help is appreciated.

7 Replies

  • Fahruz's avatar
    Fahruz
    Expert Protege

    For anyone wondering what "Interactable Filters" do and who, like me, could only find this question when searching on the net (the lack of detailed documentation on the components of the Oculus Interaction SDK is appalling), here's what I found out by digging in the source code:

    An Interactable Filter is basically an interface (its exact name is IGameObjectFilter), which has a single "Filter" method taking a GameObject as parameter and returning a boolean value saying whether the object can be interacted with or not with the interactor. Two implementations of that interface are provided: SecondaryInteractionFilter and TagSetFilter. The one you might want to use to specify which specific objects a HandGrabInteractor can interact with is the latter. You need to add TagSet and TagSetFitler scripts to the Interactable objects you want to filter for and define tags (which are just strings, not GameObject tags). Then, you add your Interactable object to the "Interactable Filters" list in the HandGrabInteractor and it will only interact with those objects.

    You can of course create your own implementation of IGameObjectFilter with the rules that you want if tags don't fulfil your requirements.

    • TacoCrypto's avatar
      TacoCrypto
      Honored Guest

      Ty man!
      I have to specify you should add TagSet on your interactor or interactable GameObject (where you have the script) and the TagSetFilter on the object this one should interact and insert this in the "interactable/interactor filters" field.

  • I have been pulling my hair out trying to get this to work, I think I have tried every combination possible.... Are you able to provide a step by step guide or screen shots of what it should look like please? I am using interactable objects and snap locations and just want certain object to be able to snap to certain snap locations.

  • Yes I did, instructions below - works for me

    Interactable Object,

    under Snapinteractor object Add Tag Set Filter (script)

    Under Optionals

    Add a Tag and name what you want

    Drag Tag Set filter to Snap interactor/Optionals/Interactable filters1

      

    On Snap Location

    Add Tag Set (script)

    Add same tag as above