Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
salvatore_cesarano's avatar
salvatore_cesarano
Honored Guest
1 year ago

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.

2 Replies

Replies have been turned off for this discussion
    • salvatore_cesarano's avatar
      salvatore_cesarano
      Honored Guest

      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.