Skip to content

Instantly share code, notes, and snippets.

@DomDomHaas DomDomHaas/stick-deadzone
Last active Aug 29, 2015

What would you like to do?
Use a deadzone for very used, old controllers which aren't percise anymore
float deadzone = 0.25f;
Vector2 stickInput = new Vector2(Input.GetAxis(“Horizontal”), Input.GetAxis(“Vertical”));
if(stickInput.magnitude < deadzone)
stickInput =;
stickInput = stickInput.normalized * ((stickInput.magnitude - deadzone) / (1 - deadzone));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.