Last active
April 8, 2018 20:21
-
-
Save cbscribe/b543311c29e6c04ab597338890c0e1c0 to your computer and use it in GitHub Desktop.
gdscript - quick input vector (8 way)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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