Hi! I’ve been trying to implement the new input system, but the started phase is triggered not only when I press the trigger but also when I release it.
It works fine with the mouse left click and with another generic controller I have which has a button trigger (it just returns a value of 0
or 1
). However, with the PS4 controller that has a gradual trigger, the input system triggers started when releasing too unless I release it really fast. I’d say it isn’t controller’s fault, because it works fine in other games, its values when releasing are ok (I’ve checked it in a web), and I’ve tried two different PS4 controllers.
This is my code:
public void Fire(InputAction.CallbackContext context)
{
if (context.started)
{
weapon.GetComponent<WeaponControl>().StartFiring();
}
else if(context.canceled)
{
weapon.GetComponent<WeaponControl>().StopFiring();
}
print("Fire triggered. Phase : " + context.phase);
}
When I press and release the mouse, these are the messages I get on the console:
FireTriggered. Phase : Started
FireTriggered. Phase : Performed
FireTriggered. Phase : Canceled
And these are the messages I get when pressing the PS4 controller trigger:
FireTriggered. Phase : Started
FireTriggered. Phase : Performed
FireTriggered. Phase : Canceled
FireTriggered. Phase : Started
FireTriggered. Phase : Canceled
These are my project settings (although I’ve changed them multiple times and none of the configurations worked):
Default Button Press Point: 0.75
Button Release Threshold : 0.5
I have no interactions or processors in my input map.
Hi, sadly I don't have a response :( But since it's an older question, I wanted to ask, if you maybe found a solution? We are having the same issue... X-box controller works fine, while PS4 fires both on press as well as on release and it's driving me nuts. Did you manage to solve it, or fight it successfully in some other way?
– Doublecheck