atmuc
Member
I use On-Screen controls like this;
Actions like Jump, Fire2 (Zoom) works with that controller. I have a problem with Fire action. That control creates a virtual GamePad device. All actions work with my physical gamepad. Only Fire action does not work with the virtual gamepad. There are 2 differences between using the virtual and physical gamepad.
var device = InputSystem.devices.FirstOrDefault(a => a.name == "Gamepad");
if (device != null)
{
InputUser.PerformPairingWithDevice(device, _playerInput.user);
}
I can see that PlayerInput Fire1 and Fire2 actions are generated by the virtual gamepad. I have that code in a component on the same gamepad with the UCC character gameobject.
public void OnFire1(InputValue value)
{
var inputValue = value.Get<float>();
Debug.LogFormat("OnFire1:{0}", inputValue);
}
What is the difference between Fire and other actions?
Actions like Jump, Fire2 (Zoom) works with that controller. I have a problem with Fire action. That control creates a virtual GamePad device. All actions work with my physical gamepad. Only Fire action does not work with the virtual gamepad. There are 2 differences between using the virtual and physical gamepad.
- On the physical gamepad right trigger data type is BYTE, on the virtual gamepad, it is FLOAT
- On the physical gamepad trigger value goes to 1.0f gradually, on the virtual game it goes from 0.0f to 0.1f directly.
var device = InputSystem.devices.FirstOrDefault(a => a.name == "Gamepad");
if (device != null)
{
InputUser.PerformPairingWithDevice(device, _playerInput.user);
}
I can see that PlayerInput Fire1 and Fire2 actions are generated by the virtual gamepad. I have that code in a component on the same gamepad with the UCC character gameobject.
public void OnFire1(InputValue value)
{
var inputValue = value.Get<float>();
Debug.LogFormat("OnFire1:{0}", inputValue);
}
What is the difference between Fire and other actions?