01-23-2018 08:03 AM
01-28-2018 08:24 AM
04-03-2018 04:42 AM
01-05-2019 03:57 AM
kailashgajara said:
My issue is same. I have applied mesh collider and can not grab the object any more. Any pointers?
06-29-2021 08:09 AM
Hi @tbkuno Could you tell me how you managed to implement this fix? I'm having the same issue, but new to unity and C#.
I also tried teleporting the object to a different location and then destroying it while it is still grabbed, which helps 90% of the time. When you say you destroyed them after some time, did you tell the OVR grabber to release the object in a script? As when I transform the location, my object loops between the new position and old one as the object is still grabbed.
I want my object to be destroyed when it enters a collider (inserting a coin into a machine).
Any help is appreciated 🙂
06-30-2021 08:23 AM
Hi, if I recall correctly I didn't have to tell OVR grabber that the object had moved, since I had to let go the grab button after having it thrown, I guess it recognized that the object wasn't there anymore. So after you ungrab the object it shouldn't loop between positions. A dirty fix in your case would be maybe just to turn off the coin's mesh renderer and collider after insterting it into the machine.
07-02-2021 06:51 AM
Thanks for the reply and your help - with it was able to create a fix by telling the OVR grabber to drop the object before its destroyed. It seemed without using ForceRelease() that the grabber doesn’t remove the references to the old grabbed object, and as they are not destroyed throws a null exception error. I'll post it here in case others may find it useful.
public class arcadeCoinManagement : MonoBehaviour
{
public OVRGrabber myOVRGrabberLeft
public OVRGrabber myOVRGrabberRight;
public void OnTriggerEnter(Collider other) {
myOVRGrabberLeft.GetComponent<OVRGrabber>().ForceRelease(myOVRGrabberLeft.grabbedObject); myOVRGrabberRight.GetComponent<OVRGrabber>().ForceRelease(myOVRGrabberRight.grabbedObject);
}
07-09-2021 09:33 PM
Had the exact same issue. I think the OVRGrabbable OnDestroy() function should run when the item is destroyed and do the ForceRelease() function but it does not appear to be working for some reason. Running it manually before destroying the object fixed this.