GearVR 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.4KViews0likes1CommentDisabling "head" scrolling
Hi, I have a scroller in my app. Scrolling works great when swiping the touchpad. You can also scroll by holding touchpad "button" and looking up/down. Is there a way to disable the second option? I want to allow drag by swipe only. I'm using Unity 5.4.2f2 with Oculus utilities 1.9.0 and OVRPlugin 1.8.01.5KViews0likes8Comments[SOLVED] Swipe reverse
Hello, does anyone have an idea on how to change the ScrollRect's direction when swiping/dragging GearVR's touchpad? I'd like to move scroller's content up when swiping down and vice versa. The only solution I found that should work is to change ScrollRect's scrollSensitivity to negative value. But it doesn't work. I even tried to invert axes in Input Manager (Vertical, Mouse Y, Oculus_GearVR_DpadY).1KViews0likes1Comment