02-20-2024 10:04 PM
Hi,
I'm working with the Meta Interaction SDK (v62.0.0) and trying to get something to work with the UseInteractable component (besides the example Spray bottle).
I've been referencing the Spray bottle closely, and for my custom object, I've written a script that implements IHandGrabUseDelegate, and assigned it to UseInteractable's "Hand Use Delegate" field. The object has HandGrabInteractables, etc. (similar to the Spray bottle). However, the methods from the interface (BeginUse, EndUse, and ComputeUseStrength) are not being called.
I'm wondering if I'm missing something (probably am), and if there is any documentation on steps / requirements for the Use interaction to work.
Thanks for any help!
03-04-2024 11:51 AM
Hi @lindy98, thanks for posting about this! I write the docs for Interaction SDK, so you can tag me in any future questions you have about the SDK. Here's the official doc for the Use interaction. You don't need to create any scripts to get the interaction working, you can just copy the structure and components of the spray bottle to your new mesh and then manually point them to the new mesh's trigger and poses. It's a tedious process, but I created a water gun that way. If you've already done that, maybe you forgot to set this field in the UseInteractable?
03-20-2024 09:16 PM
Thank you for the reply! Actually, I think the key I was looking for is the "secondary interactor". I had been trying to implement a "pull to rotate" interaction, and thought the UseInteractable would be useful (ie. OneGrabTranslate to pull, then Use) but the structure of the object I'm working with is different from the spray bottle (the whole object moves with the parent that is grabbed).
Is there any option to use a secondary interactor filter to connect, eg. a OneGrabTranslateTransformer and a OneGrabRotateTransformer? Or a custom script would need to be written?
Thank you for any help!
07-29-2024 08:51 AM - edited 08-04-2024 11:20 PM
Hi lindy, have you come up with a solution for that? I am looking at a similar problem right now and can't seem to find a solution or documentation on interaction like these.
Thanks for the help 🙂
EDIT: I have finally found out why the HandGrabUse didn't work for me. I did a bunch of digging and essentially the ComputeUseStrength method is only getting called when there is a required finger in the HandGrabUseInteractable! (under Optionals).
In the water bottle example that is the Index but you can set basically any finger on required and then it should work.
For anyone interested, this mechanic lies in the HandGrabAPI.cs file, which is used in the interface IHandGrabUseDelegate which again is implemented in the WaterSpray script.
11-01-2024 12:11 PM
Add IHandGrabUseDelegate to the class of objects you want to interact with.