Im fairly new and just want to make my 8 way movement script change the animation depending on direction and do a idle animation when im not moving. I already have all the animations setting up
extends CharacterBody2D
var SPEED = 100
func _physics_process(delta):
var input_vector = Vector2.ZERO
input_vector.x = Input.get_action_strength("Right") - Input.get_action_strength("Left")
input_vector.y = Input.get_action_strength("Down") - Input.get_action_strength("Up")
input_vector.normalized()
if input_vector:
velocity = input_vector * SPEED
move_and_slide()
I know this is probably terrible gd script but
help me
