-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can SteamVR_Input_Sources.Any refresh other sources in same action? #1082
Comments
In this case, two calls in different frame is both true: using UnityEngine;
using Valve.VR;
public class Script1 : MonoBehaviour
{
bool alter=false;
public static SteamVR_Action_Boolean Function = SteamVR_Input.GetAction<SteamVR_Action_Boolean>("Function");
// Update is called once per frame
void Update()
{
if (!alter)
{
if (Function.GetStateDown(SteamVR_Input_Sources.Any))
{
Debug.LogError("Any stateDown. frame:" + Time.frameCount);
alter = true;
}
}
else {
if (Function.GetStateDown(SteamVR_Input_Sources.RightHand))
{
Debug.LogError("Right stateDown. frame:" + Time.frameCount);
}
else {
Debug.Log("None");
}
}
}
} but in this, it is true and false: using UnityEngine;
using Valve.VR;
public class Script1 : MonoBehaviour
{
bool alter=false;
public static SteamVR_Action_Boolean Function = SteamVR_Input.GetAction<SteamVR_Action_Boolean>("Function");
// Update is called once per frame
void Update()
{
if (Function.GetStateDown(SteamVR_Input_Sources.Any))
{
Debug.LogError("Any stateDown. frame:" + Time.frameCount);
}
else
{
if (Function.GetStateDown(SteamVR_Input_Sources.RightHand))
{
Debug.LogError("Right stateDown. frame:" + Time.frameCount);
}
else {
Debug.LogError("Right not stateDown. frame:" + Time.frameCount);
}
}
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't know if it is a bug, I called an action whose source is SteamVR_Input_Sources.Any, it returns true when I press down the key. When I call the same action in next frame with source: SteamVR_Input_Sources.RightHand. it also returns true.
My aim is to using the key to realize a two-level menu. but when pressing the key once,it directly enters the secondary menu. I am sure the two two calls of action with SteamVR_Input_Sources.Any and SteamVR_Input_Sources.RightHand are both true. "Any" does not refresh "RightHand".
But when I write a script like this:
The “Any” seems refresh the "RightHand", the log "Right stateDown. frame: XXX" is never logged;
The text was updated successfully, but these errors were encountered: