How can I toggle (enable / disable) OVRGrabbable on a Unity game object in script?
I would like to toggle OVRGrabbale on a game object, subject to a boolean condition. As an example, a virtual "screw": - when it is screwed into a hole (engaged), it SHOULD NOT be grabbable by the player - when it is unscrewed (dis-engaged), it SHOULD be grabbable by the player My understanding is the boolean attribute "allowOffhandGrab" can / should be used for this, however this attribute is only read-only in OVRGrabbable.cs. Adding a setter in OVRGrabbable.cs has not had any effect on disabling OVRGrabbable during runtime. /// <summary> /// If true, the object can currently be grabbed. /// </summary> public bool allowOffhandGrab { get { return m_allowOffhandGrab; } set { m_allowOffhandGrab = value; } // Added to test grabbablity switching (ie. on / off) but does not seem to work } As a partial workaround solution, I've also tried enabling / disabling the game object's collider and rigidbody.detection components. Both of these work by allowing me to toggle the object's "grabbability" however creates interactivity issues with other game objects, so is not a feasible solution. Can someone please help? Thank you.Solved6.2KViews0likes8Commentshow to check if object is grabbed by specific controller?
Below is pseudo-code which demonstrates my desired functionality. The code needs to be placed in on the grabbed object. The part in Bold is what I need clarification on. if (_OVRGrabbable.grabbedBy == "LTouch") { //Do something } EDIT: Solution : Public OVRGrabber LeftGrabber; // Drag grabber to inspector field if (_OVRGrabbable.grabbedBy == LeftGrabber) { //Do something }4.6KViews0likes2CommentsOVRGrabber and OVRGrabbable for hand tracking instead of controllers
Hi guys, I'm trying to get the OVRGrabber and OVRGrabbable scripts working on Unity using the hand tracking instead of the joysticks, but it seems that they were made for controllers only. Is there any example of how I can grab simple objects (cubes) by using or modifying these scripts? Any clue is welcome! :smile:4.2KViews0likes4CommentsOVRGrabber and OVRGrabbable offset when grabbing
Hello I had an application in which I could catch objects using two scripts: OVRGrabber, OVRGrabbable. It was working very well 1 or 2 weeks ago, but since very recently, I can't say when exactly, it doesn't work anymore after I updated the SDK I did to see the "Hand Tracking" SDK. What happens is that as soon as I try to catch the object, the object makes a translation behind me and doesn't move as long as I catch it, as soon as I release it, it falls down. The gameobjects in my objects are not the children of another gameobject, so the offset has nothing to do with parentage. I've exactly follow the instruction in this tutorial on Youtube (I can't post link...) : Unity Tutorial : VR, Oculus Avatar and Grabbing Object setup IN 5 MINUTES Here are the components that are on my left hand, right hand and on an object to catch : Object : Left hand anchor : Right hand anchor: I already try to play with "Is Trigger" parameter but nothing was better. Hope someone got a solution !3.3KViews0likes1CommentOculus OVRGrabber and OVRGrabbable Script Issues on scene reload
I have an OVRPlayerController set up in the Unity Survival Shooter example. I can grab the gun with either hand and shoot. I even have a script that references the Grabbable Object and adjusts it position when held. ( since the object offset on the OVRGrabbable doesn't actually work). It all works perfectly until the game end. Once it end the game reloads the same scene to play again. On the second time you play, the grabbing of objects becomes erratic and sometimes doesn't work at all. There is some Serialized data or a Coroutine being kept in the reloaded scene. It's not any of my code so I was wonder what it is in the Grabbing scripts. The game works perfectly until I reload the scene.1.8KViews1like3CommentsOVR Grabbable Snap to hand (i.e. a gun) - Unity
Ive spent way longer than i thought i would on this, like days... So id like to use the grabing scripts to grab a gun model and have it snap to my hand in the correct rotation. So far ive tried setting the position and rotation to a GameObject, ive tried placing the GameObject in several places, either a parent of the gun itsself or at 0,0,0 in the world and it allows me to grab it but it snaps to a weird position and its never the same position its always a random angle and in the center of the gun model, ive serched tens and tens of forums and youtube videos for a solution but none of the suggestions work, any help would be greatly aprteciated, please and thanks!1.7KViews0likes1CommentNot sure why OVRGrabber script is not working correctly with customhands??
The problem is that the hands are offset way ahead of the player and tracking is with opposite hands I am using customhand left and right. both parent transform and player are set to OVRCameraRig and OVRPlayerController respectively.Solved1.5KViews0likes2CommentsHow to grab object with TWO hands
Using the Oculus Integration package in Unity, I'm trying to figure out how to grab a gun with TWO hands, where one hand grabs the barrel and the other grabs the handle. I want when I move the handle, the barrel hand stays attached, but the gun itself adjusts accordingly. I'm a bit new to vr / unity development, and I can't find a thing that supports "two handed" grips with the Oculus Integration package. Can anybody point me in the right direction? Thanks in advance.1.1KViews0likes0CommentsQuest Grabbing Sticking to Head
I'm trying to set up OVRGrabber/Grabbable, but when the player grabs an object, the object is moved to where their head was but then stays in place until let go. I'm using the latest Oculus SDK. Any advice? I'm new to developing on Unity, so I'm sorry if this is a dumb question. Controllers: Example Object:800Views0likes1CommentGrabble Not Working?
I am creating a new game in Unity with the Oculus SDK. I am using Unity 2019.2.8f. I took the LocalAvatarWithGrab and put it into my scene. I also brought in a toy block to verify everything is working with grabbing and it does. I can pick up the blocks and throw them. I added a gun model that I purchased on the asset store. It is pretty basic and low poly. I added a Mesh Collider first and then in trying to get it to work just added a box collider. Didn't make a difference. I added the RigitBody and OVRGrabbable to the gun object. I copied all of the settings carefully from the toy blocks to the gun. The gun just hangs there in the scene. Doesn't even adhere to physics like it should. I have looked and looked and compared everything and everything looks set up correctly. Gravity is turned on. There is a mass value. The gun does have an animator on it, but I can't see how that would affect it. Can anyone give me some ideas what to look for that will help?797Views0likes1Comment