This question was
closed Oct 09, 2017 at 05:06 PM by
Wannabuhh for the following reason:
Other
Question by
Wannabuhh · Oct 06, 2017 at 12:31 AM ·
vrinput.getaxisstring comparison
How do you build a string from user input?
I want to build a string with user input. I am retrieving coordinates from the vive controller trackpad to determine whether or not the string should be appended. My problem is that I can't figure out a way to append only one character if the user keeps their hand on the input.
void Update()
{
device = SteamVR_Controller.Input((int)controller.index);
//If finger is on touchpad
if (device.GetTouch(SteamVR_Controller.ButtonMask.Touchpad))
{
//Read the touchpad values
touchpad = device.GetAxis(EVRButtonId.k_EButton_SteamVR_Touchpad);
if (touchpad.y < 0.0)
{
for (int i = trickAddress.Length - 1; i < trickAddress.Length; i++)
{
if (trickAddress[i - 1] != trickAddress[trickAddress.Length - 1])
{
trickAddress.Append('0');
Debug.Log(trickAddress.ToString());
}
}
}
}
}
Comment
Follow this Question
Related Questions
Unity Input system not returning correct values for HTC Vive touchpad. 2 Answers
How do you access the input Axes and Buttons in XR 1 Answer
Do I need to use the Input Manager to register all input axes? 0 Answers
Input.GetAxis() for HTC Vive controller not working in build 1 Answer
VR Projects in Mac OS 1 Answer