How to Call an Input Once?

Hey There Everyone,

I’m trying to use the ‘new’ InputSystem and call an input only when a bool returns false. Now this works but only when the scene first starts, if the bool was to go true then false again the input will still work


Within this image, its the if statement which is checking and activating a function where the input code is.

Can someone assist me please? (I hope my explanation isn’t to hard to understand)

void Update()
{
// Check if isSurface is false before allowing the input
if (!isSurface)
{
UpControl();
}
}

void UpControl()
{
// Input action will only be called if isSurface is false
input.Submarine.Up.started += UpAction;
input.Submarine.Up.performed += UpAction;
input.Submarine.Up.canceled += UpStop;
}

void UpAction(InputAction.CallbackContext c)
{
if (!isSurface)
{
up = true;
}
}

void UpStop(InputAction.CallbackContext c)
{
if (!isSurface)
{
up = false;
}
}