I am receiving touchpad input values from both VR controllers. However, I would like to distinguish between the left and right controller values. Specifically, when I touch the left controller's touchpad, I want to save those values in the "Vector2 moveL," and when I touch the right controller's touchpad, I want to store the values in "Vector2 moveR."
Current code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Valve.VR;
public class CursorController : MonoBehaviour
{
public float sensativity = 0.1f;
public float maxSpeed = 1.0f;
public SteamVR_Action_Vector2 moveValue;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
Vector2 moveL = Vector2.zero;
Vector2 moveR = Vector2.zero;
// Check if the controller input is coming from the left or right controller
moveL.x = moveValue.axis.x;
moveL.y = moveValue.axis.y;
moveR.x = moveValue.axis.x;
moveR.y = moveValue.axis.y;
Debug.Log("Left Controller: " + moveL);
Debug.Log("Right Controller: " + moveR);
}
}
I want to differenciate left and right controller touchpad values.