OVRTouchpad.TouchHandler doesn't exist.
I am using Unity 2018.1.1f1, and I have imported the latest Unity_Sample_Framework and Oculus Utilities. I am running Windows 10. Here is my code: using UnityEngine; using System.Collections; using System.Collections.Generic; public class Teleporter : MonoBehaviour { public GameObject TeleportMarker; public Transform Player; public float Raylength = 50f; void Start() { OVRTouchpad.Create(); OVRTouchpad.TouchHandler += TouchpadHandler; } void Update() { Ray ray = new Ray(transform.position, transform.forward); RaycastHit hit; if(Physics.Raycast(ray, out hit, Raylength)) { if(hit.collider.tag == "floor") { if (!TeleportMarker.activeSelf) { TeleportMarker.SetActive(true); } TeleportMarker.transform.position = hit.point; } } } void TouchpadHandler(object sender, System.EventArgs e) { OVRTouchpad.TouchArgs args = (OVRTouchpad.TouchArgs)e; if(args.TouchType == OVRTouchpad.TouchEvent.SingleTap) { } } } For some reason, OVRTouchpad.TouchArgs and OVRTouchpad.TouchHandler don't exist. Can someone help me with this?1.1KViews0likes2CommentsOculus Go - character movement using touchpad press, in unity3d?
my end goal is to be able to move character forward, backward, and strafing left and right by detecting where you are touching on the touchpad and if you are pressing in on the touchpad (and not just touching it). using something like if OVRInput.Get(OVRInput.ButtonTouchpad); to see if you are pressing in on the touchpad. also OVRInput.Get(OVRInput.Axis2.PrimaryTouchpad); to see where you are touching, and then setting up values that will move you in the proper direction. i am pretty new to unity and game development. but if anyone could help me wrap my head around how to set this up it would be much appreciated. to at least get me on the right track.5KViews0likes4CommentsGearVR Touchpad Swipe Problem
Hi you all, I have a huge problem with my code to communicate with OVRTouchpad.cs and my Script with player, OVRSwipeJVD.cs. First when I run the game everything is fine and player interact with OVRTouchpad.cs quite nicely with smooth animation, But after losing or winning a battle the game backs to main menu and from there when I load the same or other levels- My player stops all kind of interaction, in fact I got this msg in console. MissingReferenceException: The object of type 'Animator' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object. UnityEngine.Animator.SetBool (System.String name, Boolean value) (at C:/buildslave/unity/build/artifacts/generated/common/modules/Animation/AnimatorBindings.gen.cs:283) OVRSwipeJVD.HandleTouchHandler (System.Object sender, System.EventArgs e) (at Assets/BOX_scene/OVRSwipeJVD.cs:34) OVRTouchpad.HandleInputMouse (UnityEngine.Vector3& move) (at Assets/OVR/Moonlight/Scripts/OVRTouchpad.cs:221) OVRTouchpad.Update () (at Assets/OVR/Moonlight/Scripts/OVRTouchpad.cs:134) OVRTouchpadHelper.Update () (at Assets/OVR/Moonlight/Scripts/OVRTouchpad.cs:256) Below I put my OVRSwipeJVD.cs code using UnityEngine; using System; public class OVRSwipeJVD : MonoBehaviour { public Animator anim; public Animation animation; public int restore_timer=0; void Start () { OVRTouchpad.Create(); OVRTouchpad.TouchHandler += HandleTouchHandler; anim = GetComponent<Animator>(); } void HandleTouchHandler(object sender, System.EventArgs e) { restore_timer++; OVRTouchpad.TouchArgs touchArgs = (OVRTouchpad.TouchArgs)e; if (touchArgs.TouchType == OVRTouchpad.TouchEvent.SingleTap) { //Debug.Log("SINGLE CLICK\n"); } if (touchArgs.TouchType == OVRTouchpad.TouchEvent.Down) { //Debug.Log("DOWN SWIPE\n"); anim.SetBool("Leftblow",true); restore_timer = 0; } if (touchArgs.TouchType == OVRTouchpad.TouchEvent.Up) { //Debug.Log("UP SWIPE\n"); anim.SetBool("Rightblow",true); restore_timer = 0; } if (touchArgs.TouchType == OVRTouchpad.TouchEvent.Right) { //Debug.Log("RIGHT SWIPE\n"); anim.SetBool("JumpBack",true); restore_timer = 0; } if (touchArgs.TouchType == OVRTouchpad.TouchEvent.Left) { anim.SetBool("SwingLeftBlow",true); restore_timer = 0; } if(restore_timer==20) { anim.SetBool("BackToMain",true); anim.SetBool("Rightblow",false); anim.SetBool("Leftblow",false); anim.SetBool("SwingLeftBlow",false); anim.SetBool("MagicThrow",false); // player getting hit anim.SetInteger("playerhitmax",0); anim.SetInteger("playerhit1",0); anim.SetInteger("playerhit2",0); anim.SetInteger("playerhit3",0); anim.SetBool("playerhitmid",false); restore_timer=0; } } } I am Using the built in OVRTouchpad.cs nothing changed in these. Can Anyone help me with it? Thanks in advance, Take care!1.4KViews0likes1Comment