I have a controller script that contains
private void Awake()
{
playerController = new PlayerController();
playerController.PlayerInput.Jump.performed += JumpPressed;
}
public void JumpPressed(InputAction.CallbackContext obj)
{
Debug.Log("call");
}
then i have a combat state where i would like to check if say jump is pressed. In the old inputsystems used
if (Input.GetButtonDown("Jump"))
{
player.StateMachine.ChangeState(player.JumpState);
}
how do i change
Input.GetButtonDown("JUMP")
to work with my newly set up playerController
i have many different player states that i only want certain interactions to be able to happen if i put the Jump function inside JumpPressed you would be able to jump at any time
so that is why i want to check if GetButtonDown inside the state and not the controller