You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
using UnityEngine;using Valve.VR;publicclassScript1:MonoBehaviour{publicstaticSteamVR_Action_BooleanFunction= SteamVR_Input.GetAction<SteamVR_Action_Boolean>("Function");// Update is called once per framevoidUpdate(){if(Function.GetStateDown(SteamVR_Input_Sources.Any)){
Debug.LogError("Any stateDown. frame:"+ Time.frameCount);}else{
Debug.Log("Not any stateDown. frame:"+ Time.frameCount);if(Function.GetStateDown(SteamVR_Input_Sources.RightHand)){
Debug.LogError("Left stateDown. frame:"+ Time.frameCount);}}}}
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:
In this case, two calls in different frame is both true:
using UnityEngine;using Valve.VR;publicclassScript1:MonoBehaviour{boolalter=false;publicstaticSteamVR_Action_BooleanFunction= SteamVR_Input.GetAction<SteamVR_Action_Boolean>("Function");// Update is called once per framevoidUpdate(){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;publicclassScript1:MonoBehaviour{boolalter=false;publicstaticSteamVR_Action_BooleanFunction= SteamVR_Input.GetAction<SteamVR_Action_Boolean>("Function");// Update is called once per framevoidUpdate(){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);}}}}
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: