Forum Discussion
Avotas
2 years agoExplorer
Pulling the sword from the stone!
Question for everyone. I am attempting to use The Meta XR Interaction SDK (v64.0 on Unity 2022.3) to pull a sword from a stone. The sword uses Meta's 'One Grab Free Transformer' with constraints on the X,Z to prevent the sword from wobbling. At a certain height (Y) I want to release those constraints so the sword can be wielded in all three dimensions.
Can constraints be targeted/altered programmatically? Is there a better method to achieve a similar result?
Solution: A prefab swap (with and without the constraint) was used as workaround. By tracking the last hand used [_lastHandGrabInteractor] and then forcing a drop [_lastHandGrabInteractor.ForceRelease()] I was able to attach the substituted prefab with [_lastHandGrabInteractor.ForceSelect(replacementObject, true]. It's not a perfect solution, but it was successful.
3 Replies
- swang81Member
1. when controller model overlap with the sword (+ hand grab action), the sword will move along Z axis with controller Z movement.
2. when Z movement >= max length, attach the sword to your hand(controller)
- AvotasExplorer
Thank you. It was a good secondary solution!
- AvotasExplorer
Solution: A prefab swap (with and without the constraint) was used as workaround. By tracking the last hand used [_lastHandGrabInteractor] and then forcing a drop [_lastHandGrabInteractor.ForceRelease()] I was able to attach the substituted prefab with [_lastHandGrabInteractor.ForceSelect(replacementObject, true]. It's not a perfect solution, but it was successful.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 4 years ago
- 12 years ago
- 3 years ago