I want to use the new action based approach in the XR Interaction Toolkit which uses the new input system. The sample project for the XR Toolkit works fine, but when I use the new input system on my own project the button actions property “triggered” always returns false.
I use Unity 2019.3 at the moment with the legacy XR system. I set up a new project and imported the XR Toolkit (0.10.0) together with the “Default Input Action”.
The Scene contains the XR Interaction Manager, the Roomscale XR Rig (Action based) as well as a Locomotion System. A basic Input Test script is attached to the controller GameObjects and looks like:
public class InputTest : MonoBehaviour
{
public InputActionReference select;
void Update()
{
var selectAction = select.action;
if (selectAction.triggered)
{
Debug.Log("triggered");
}
}
}
A proper InputActionReference is set. It is the Select action from the Default Input Action sample. The Select Action Type is a Button and in the player settings I activated the new Input System, but the Debug message never appears in the console and if I print the value of the selectAction.triggered variable it is always false. If I try the readValue() function of the selectAction I get proper values like 0 and 1.
The Action is also Enabled.
Does anyone have an idea why the triggered value is always false?