03-13-2024 12:52 PM
I'm trying to instantiate both a SnapInteractable and SnapInteractor from code. After both objects are instantiated, I want to then attach the interactor to the interactable.
Here's a demo video to demonstrate what I'm going for: https://www.dropbox.com/scl/fi/zcpshr4bjw2okacy0ae29/2024-03-13-at-12.49.17.mp4?rlkey=so0s0r316vykvi...
The only way I can get the interaction to occur is by using my hand to grab the interactor, and place it near the interactable.
I've tried setting the position via code (hoping proximity would trigger a snap interaction), but no luck.
I've also tried using the following code but no luck there either.
Solved! Go to Solution.
03-25-2024 09:08 AM
Hi @filmgrvin, the SnapInteractor has some methods you can use to force select the interactor, like this:
03-13-2024 05:11 PM
Just wanted to add, if the _defaultInteractable field on SnapInteractor was public, this would be a non-issue...
03-25-2024 09:08 AM
Hi @filmgrvin, the SnapInteractor has some methods you can use to force select the interactor, like this:
03-27-2024 06:20 PM
Oh my goodness thank you so much! That worked, you're a life saver
03-28-2024 08:25 AM
I'm glad I could help 🙂 If you have any questions about Interaction SDK in the future, please tag me; I write the docs for the team and also engage with users here on the forum! Did you try using any of the official documentation to answer your question? If you did, I'm always looking for gaps in it and ways to make it more usable, so I'd love your feedback.
07-22-2024 04:33 PM
Hi! I am facing the same problem and can't get your suggested solution to work. I have a extended class CustomSnapInteractor where I call
base.SetComputeCandidateOverride(() => interactable);
base.SetComputeShouldSelectOverride(()=>true);
but I am trying to do this while the snapped object is currently snapped to another snapInteractable as I would like to manually move it away from one to another.
If this is not something that will work another approach I could pursue is attempting to insert some sort of conditional check in the SnapInteractor that only accepts a snap to a SnapInteractable if something.
Thanks for any help you can provide!
07-31-2024 09:31 AM
Hi, I've switched teams and no longer work on Interaction SDK, but you can direct any questions to @ffejnosliw. Thanks 🙂
10-24-2024 01:29 PM
You are awesome! 😁