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)
{
}
}
}
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?