Good Day,
I am developing a menu system that loads user profiles and populates them as a list.
The thing is, I want to use a vive touchpad to scroll through the list of profiles. I don’t want to use VRTK, because it breaks my project.
Please assist.
Thanks in advance
We need more details here to help you. How are you accessing the controllers? Are you using the SteamVR plugin? I agree with not using VRTK but are you working on a script of your own?
I have attached a script that I am working on but I cannot seem to get it right. How do i link my script to a scrollable content? I am only usingSteamVR plugin. I am new to unity.
public class Scroller_Manager : MonoBehaviour
{
[SerializeField]
private SteamVR_TrackedController controllerLeft;
[SerializeField]
private SteamVR_TrackedController controllerRight;
private SteamVR_TrackedObject trackedObject;
private SteamVR_Controller.Device device;
private float x, y;
private void OnEnable()
{
controllerLeft.PadTouched += Controller_PadTouched;
controllerRight.PadTouched += Controller_PadTouched;
//device = SteamVR_Controller.Input((int)trackedObject.index);
}
private void OnDisable()
{
controllerLeft.PadTouched -= Controller_PadTouched;
controllerRight.PadTouched -= Controller_PadTouched;
}
private void Controller_PadTouched(object sender, ClickedEventArgs e)
{
if (e.padY > 0)
{
print(“Move up”);
}
else if (e.padY < 0)
{
print(“Move down”);
}
//print("Pad Touched X : " + e.padX);
//print("Pad Touched Y : " + e.padY);
}
//private void Update()
//{
// if (device == null)
// {
// device = SteamVR_Controller.Input((int)trackedObject.index);
// }
// if (device != null)
// {
// if (device.GetTouch(SteamVR_Controller.ButtonMask.Touchpad))
// {
// Vector2 touchPoint = (device.GetAxis(Valve.VR.EVRButtonId.k_EButton_Axis0));
// print(“Touched”);
// }
// }
// else
// {
// print(“Device does not exist”);
// }
//}
}