I’m trying to implement simple controls with the new input system but I cannot figure out how to access a certain property in the event object. Picture of my bindings:
I successfully make my player jump like so after subscribing to the jump event:
private void Jump_performed(InputAction.CallbackContext obj)
{
Debug.Log("Jumped");
rigidBody.velocity = new Vector2(0, 5);
}
However, I can’t figure out how to access Up/Down/Left/Right as seen in my bindings above. Everything I’m finding prints W/A/S/D instead. Example:
private void Move_performed(InputAction.CallbackContext obj)
{
//Prints W, A, S ,D
Debug.Log(obj.control.displayName.ToString());
//Displays Move...
Debug.Log(obj.action.name.ToString());
//Displays PlayerControls...
Debug.Log(obj.action.actionMap.name.ToString());
}
I looked at the reference and couldn’t figure it out either even though synthetic controls seemed similar near the bottom: Controls | Input System | 1.0.2
Ideally I’ll be moving my character up/down/left/right depending on what is being pressed. I don’t want to reference W/A/S/D like I currently have.
Edit: I found this and still don’t know how to check what the composite binding is on event: Input Bindings | Input System | 1.0.2
