I am currently working on a platform game and am not sure how to detect when a key is lifted using the new input system.
I would like to know, if possible, can you detect when the key is lifted and assign the value to a bool, using my current settings.
So far, I have this code:
public void Jump(InputAction.CallbackContext context)
{
if (context.performed)
{
jump = true;
wasJumpLifted = true;
}
if (context.canceled)
{
wasJumpLifted = false;
}
else
{
wasJumpLifted = true;
}
}
The problem with this code is that it will only set wasJumpLifted to true if you press down the jump key again, as the entire function will not be invoked without me pressing the jump key.
↧