Skip to main content
New Participant
October 9, 2024

Multiple Snap Interactor for single object

Hello,

I am developing a scene in which the player builds an object with different Lego pieces.

I want to obtain a high level of realism, and for this reason I want to allow mistakes.
The player must be able to grab pieces from different poses, and I have achieved that with HandGrabPoses.

Now I am working at Interactions between pieces when they are built.
I am using SnapInteractor for pins and SnapInteractable for straight pieces with holes.
The user must be free to attach pieces from both sides, so I have added two different SnapInteractor, for each side of the pin.
The problem is that Unity only recognise one SnapInteractor, and always snap the pin at the same side.
The other SnapInteractor only works when the first SnapInteractor is disabled.

    This topic has been closed for replies.

    2 replies

    Inspiring
    October 11, 2024

    Hi salvatore_cesarano,

    Do you already have your snap interactors in an interactor group? If not, does putting them in a `BestHoverInteractorGroup` lead to behavior more like what you're hoping for?

    https://developers.meta.com/horizon/documentation/unity/unity-isdk-interactor-group/#besthoverinteractorgroup

    New Participant
    October 15, 2024

    Thank you because I didn't know the BestHoverInteractorGroup.
    Anyway it still doesn't work good. I've added the SnapInteractors as Interactors and I've also added a CandidatePositionComparer as a CandidateComparer (because I want it to snap the nearest SnapInteractor).
    Anyway here I need to specify the CompareOrigin, while I want the system to calculate automatically distances to compare between the SnapInteractors and the current Interactable selected.