Skip to main content
New Participant
October 26, 2023

How can I attach a SnapInteractor in code so that it doesn't get pushed?

When a snap interactor snaps to a snap interactable "by hand", it doesn't get pushed by other objects until it unselects. However, when I try to do it through code, I can push it with other objects.

This is how I select it with code:

        glassInteractable.AddSelectingInteractor(glassInteractor);
        glassInteractor.Select();


In the Debug view in Unity, I can see that the Grabbable's Points list is empty. When I snap it by hand it has one element. Maybe it's relevant.

Thanks for any help.

This topic has been closed for replies.

1 reply

filmgrvin
New Participant
March 13, 2024

Any chance you got this working? My build crashes every time I try to execute this code...