Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity input system

private void OnEnable()
{
	playerInput = GetComponent<PlayerInput>();
    playerInput.actions["Action"].performed += HandleAction
}

private void Update() {
	value = playerInput.actions["Value"].ReadValue<Vector2>();
}

private void HandleAction(InputAction.CallbackContext context)
{
	HandleJump();
}
Source by gamedevbeginner.com #
 
PREVIOUS NEXT
Tagged: #unity #input #system
ADD COMMENT
Topic
Name
7+2 =