Skip to content

Instantly share code, notes, and snippets.

@cbscribe
Last active April 8, 2018 20:21
Show Gist options
  • Save cbscribe/b543311c29e6c04ab597338890c0e1c0 to your computer and use it in GitHub Desktop.
Save cbscribe/b543311c29e6c04ab597338890c0e1c0 to your computer and use it in GitHub Desktop.
gdscript - quick input vector (8 way)
var vect = Vector2()
vect.x = Input.is_action_pressed("right") - Input.is_action_pressed("left")
vect.y = Input.is_action_pressed("down") - Input.is_action_pressed("up")
vect = vect.normalized()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment