Input in OnTriggerStay2D

private void OnTriggerStay2D(Collider2D collision)
{
Player ply = collision.GetComponentInParent();
if (!ply.dead)
{
if (gm.inputs[ply.player].B && !gm.prevInputs[ply.player].B && !ply.itemEquiped && ply.takeCooldown <= 0)
{
//stuff
}
}
}
}

I’m making a 2D game in which there’s items you can pickup when pressing B
Everything works fine in the editor but doesn’t on the build, because OnTriggerStay2D only runs when FixedUpdate does so the Inputs get broken…
Any workaround ?

Use a flag, update it on trigger enter / stay / exit as you need it, then make the input in Update() callback checking that flag and other conditions.