Godot Version
4.4
Question
I was messing around in the animation player with positioning for the attack animation and now my character will no longer move. The animations play just fine. As far as I know it happened after giving the attack animation a position property track but ive since removed it with no luck. I also may have deleted the RESET animation around this time if that has anything to do with it?
heres the characterbody2D script
extends CharacterBody2D
@onready var speed = 1000.0
const jump_velocity = -3000
@onready var anim_tree : AnimationTree = $AnimationTree
@onready var stun_timer = $“…/Timer”
@onready var stun = false
@onready var timer_limit_movement = $“…/Timer”
#animations
func _ready() → void:
anim_tree.active = true
func _process(delta):
update_animation_parameters()
var direction = Vector2.ZERO
func _physics_process(delta: float) → void:
# Add the gravity.
if not is_on_floor():
velocity += get_gravity() * delta
# Handle jump.
if Input.is_action_just_pressed("jump") and is_on_floor():
velocity.y = jump_velocity
# Get the input direction: -1, 0, 1
direction = Input.get_axis("move_left", "move_right")
# apply character movement animation on direction input
if direction== 0:
pass
#Apply movement
if direction:
velocity.x = direction * speed
else:
velocity.x = move_toward(velocity.x, 0, speed)
move_and_slide()
func update_animation_parameters():
if velocity.x == 0:
anim_tree[“parameters/conditions/idle”] = true
anim_tree[“parameters/conditions/is_moving”] = false
else:
anim_tree[“parameters/conditions/idle”] = false
anim_tree[“parameters/conditions/is_moving”] = true
if Input.is_action_just_pressed(“Test_attack_1”):
anim_tree[“parameters/conditions/attack”] = true
stun = true
timer_limit_movement.start()
else:
anim_tree["parameters/conditions/attack"] = false
anim_tree["parameters/walk 2/blend_position"] = direction
func _on_timer_timeout() → void:
stun = false
please help D: ive tried everything I can think of…