I’m using a value action type with a composite binding to move a player object. The started and performed callbacks work just fine but cancelled doesn’t get called during gameplay. Only when I click outside the game window in the editor does it get called.
According to the manual:
Also to note:
Simplified code:
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class Example : MonoBehaviour
{
private PlayerInputActions playerInput;
private InputAction keyMove;
void Awake()
{
playerInput = new PlayerInputActions();
}
void OnEnable()
{
keyMove = playerInput.CamControl.Move;
keyMove.Enable();
keyMove.canceled += KeyMove;
keyMove.performed += KeyMove;
}
void OnDisable()
{
keyMove.Disable();
}
private void KeyMove(InputAction.CallbackContext context)
{
if (context.canceled)
{
print("Moving cancelled");
}
else if (context.performed)
{
print("Moving");
}
}
}
So either I’m not understanding actuated correctly or my code contains errors or this is a bug?
Unity 2022.3.24f1 & Input System 1.7.0