Forum Discussion
jaumet2000
4 years agoHonored Guest
Check if an object is grabbed
Hello guys. I can't find a way to check if an object is grabbed or not, a boolean that is true if it is grabbed and false if it is not. The attached image is the components that the object that I w...
- 4 years ago
There might be an easier solution but when I did this, I also wanted a few other features so I created my own ITransformer and put it in the Grabbable Script. Once you do this, you can just copy-paste the code in the default ITransformer you want. In an ITransformer, there is a method called BeginTransform() that is called when an object is first grabbed and EndTransform() when it is unselected. I'd recommend saving a bool somewhere else that is changed by these methods.
EDIT: If you want to get the gameobject inside the iTransformer script use this (assuming the script is on the gameobject):
_grabbable.Transform.gameObject
hasenav
4 years agoExplorer
Hi! Yo can check the state in HandGrabInteractor:
private HandGrabInteractor handGrab;
....
if (InteractorState.Select == handGrab.State) -- then a object is grabbed
- Vr-Number1-Bachelor3 years agoHonored Guest
Hey, I would love to know where you found those states. I am in desperate need for Documentation, but have found that Meta fails to provide any, at least any that are easily accessible or findable.
- Fahruz3 years agoExpert Protege
As you say, there doesn't seem to be any doc about those states so you have to look in the source code of InteractorState to find out all the states of that enum, which are:
Normal,
Hover,
Select,
Disabled
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
- 2 years ago
- 8 years agoAnonymous