Move an object along the z axis by Oculus Go touchpad
I have written a script to pick an object with a rigidbody component by the ray casted from the controller and move it around. I make the object, the child of the controller to move it in the scene then. I already have a script to detect the object by the ray casted from a controller, picking it up and moving it up and down and left and right with the controller. Now , I want to make that selected object along the z-axis by using the touchpad of oculus go. However I am not sure how to do it. This is the function i am using it to attach to the parent: public virtual void Store(Transform NewParent) { //The following stops the object being effected by physics while it's in the players hand rb.isKinematic = true; //And fixes it to the new parent it is given by the player script to follow. transform.parent = NewParent; //It then resets it's position and rotation to match it's new parent object //transform.localRotation = Quaternion.identity; //transform.localPosition = Vector3.zero; } and then i use it in the pointer class to attach it to the ray: void Intract() { //We set up the input "OculusPrimaryIndexTrigger" in the Input manager if (OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger)) { selectVisual.ClearObject(); //Check if you are holding something you can throw first if (inHand != null) { inHand.Release(controllerRef.forward, throwForce); inHand = null; //We do this check here to prevent Errors if you have nothing selected } else if (selectedObject != null) { //Check if you can pick up the selected object second if (selectedObject.GetComponent<PickUp>()) { //Beacuse PickUp is a child of PropBase, we can ask InHand to store selectedObject as PickUp, rather than use GetComponent inHand = selectedObject as PickUp; inHand.Store(holdingRef); //If non of the above were valid then simple call the trigger function of the selected object } else { selectedObject.Trigger(); } } //If you have a object that you need to hold down a button to intract with } else if (pointerOver != null) { if (pointerOver.GetComponent<PropBase>()) { selectedObject = pointerOver.GetComponent<PropBase>(); } else { selectedObject = null; } } else { selectedObject = null; } } } If anyone could point me in a right direction or help me with this, I would greatly appreciate it! Thanks in advance!632Views0likes0CommentsRestrict the movement of the object attached to the controller in Oculus Go
Hey, I have written a script to pick an object with a rigidbody component by the ray casted from the controller and move it around. Now, I want to limit the movement of the object. After parenting the object to the controller, i want it to move in just one direction, e.g. along the x-axis only. I tried doing it by freezing the object's position in its rigid body component, however, it as no effect, when the controller is attached to the object. If anyone could help me with this, I would greatly appreciate it! Thanks in advance.745Views0likes0CommentsOculus Go Controller touchpad event
Hi, I am developing VR application on WebVR, how can I get Oculus Go Controller touchpad event/ touch position? Here is a guide of Unity only : https://developer.oculus.com/documentation/unity/latest/concepts/unity-ovrinput/#unity-ovrinput-go-controller540Views0likes0Comments