Input action for jumping
unknown
csharp
7 months ago
581 B
39
Indexable
//In my player movement script
public void OnJump(InputAction.CallbackContext context)
{
if (context.started)
{
DebugEditor.Log("Jumping start");
}
if(context.performed)
{
DebugEditor.Log("Jumping performed");
}
}
//In my input manager script
private void OnEnable(){
Input = new InputMap();
Input.PlayerInput.Enable();
Input.PlayerInput.JumpInput.performed += PlayerMovement.instance.OnJump;
}
private void OnDisable(){
Input.PlayerInput.JumpInput.performed -= PlayerMovement.instance.OnJump;
}
Editor is loading...
Leave a Comment