godot_recipes icon indicating copy to clipboard operation
godot_recipes copied to clipboard

[Discussion] 8-Directional Movement/Animation

Open cbscribe opened this issue 4 years ago • 2 comments

Discussion for http://godotrecipes.com/2d/8_direction/

cbscribe avatar Jun 27 '21 19:06 cbscribe

Hi I cant seem to get direction number 4, when I try the code in the keyboard input section.

justdaft avatar Nov 22 '21 07:11 justdaft

I fixed it by adding a = stepify(input_dir.angle() , PI/4) / (PI/4) a = wrapi(int(a), 0, 8) to the keyboard-input code section, I copied the way you did it in the mouse control section.

Thanks

justdaft avatar Nov 22 '21 09:11 justdaft