Hello, following along with a tutorial and I am getting errors that I do not understand and that are not present in the tutorial.
My code is:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR;
public class Handpresence : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{}
private InputDevice targetDevice;
List<InputDevice> devices = new List<InputDevice>();
InputDeviceCharacteristics rightControllerCharacteristics = InputDeviceCharacteristics.Right | InputDeviceCharacteristics.Controller;
InputDevices.GetDevicesWithCharacteristics(rightControllerCharacteristics, devices);
foreach (var item in devices)
{
Debug.Log(item.name + item.characteristics);
}
if(devices.Count > 0)
{
targetDevice = devices[0];
}
}
// Update is called once per frame
void Update()
{
targetDevice.TryGetFeatureValue(CommonUsages.primaryButton, out bool primaryButtonValue);
if (primaryButtonValue)
Debug.Log("Pressing Primary Button");
}
}
I have 22 compiler errors that are posted here.