Animation Player doesn't play animation in edit mode

I’m using Godot version 3.5.1

I am using frame coords to change the x coordinate of the cell on my sprite sheet. I have animations for walking and idling in 4 directions. My sprite is stuck facing left and doesn’t animate when played no matter which animation I play. I have tired directly changing the frame coords directly in the sprite properties but it won’t let me change the X coordinate at all and will switch back to the number 8 no matter what I type in. The animation work fine in game but when I use the animations in cutscenes they are back to being stuck facing left.

This is all the code within my player scene almost all is copied from heart beast RPG tutorial I am also using the AnimationTree from the same tutorial if you’re familiar. I would provide a video for more clarity but I can add attachments because I’m a new member to the forum. I’m sorry.

extends KinematicBody2D

const ACCELERATION = 500
const MAX_SPEED = 80
const FRICTION = 500
var velocity = Vector2.ZERO
var character
onready var animationPlayer = $Parts/AnimationPlayer
onready var animationTree = $Parts/AnimationTree
onready var animationState = animationTree.get(“parameters/playback”)

func _ready():
pass

func _process(delta):

character = $Parts
character.get_node("Head").frame_coords.y = Global.head_global
character.get_node("Body").frame_coords.y = Global.body_global
character.get_node("eye_left").frame_coords.y = Global.eye_left_global
character.get_node("eye_right").frame_coords.y = Global.eye_left_global
character.get_node("eyes_front_left").frame_coords.y = Global.eye_left_front_global
character.get_node("eyes_front_right").frame_coords.y = Global.eye_right_front_global
character.get_node("eyebrow_front_left").frame_coords.y = Global.eyebrow_value_global
character.get_node("eyebrow_front_right").frame_coords.y = Global.eyebrow_value_global
character.get_node("eyebrow_left").frame_coords.y = Global.eyebrow_value_global
character.get_node("eyebrow_right").frame_coords.y = Global.eyebrow_value_global
character.get_node("mouth_front").frame_coords.y = Global.mouth_value_global
character.get_node("mouth_right").frame_coords.y = Global.mouth_value_global
character.get_node("mouth_left").frame_coords.y = Global.mouth_value_global
character.get_node("shirt").frame_coords.y = Global.shirt_value_global
character.get_node("pants").frame_coords.y = Global.pants_value_global

var ap = character.get_node("AnimationPlayer")

func _physics_process(delta):
var input_vector = Vector2.ZERO
input_vector.x = Input.get_action_strength(“ui_right”) - Input.get_action_strength(“ui_left”)
input_vector.y = Input.get_action_strength(“ui_down”) - Input.get_action_strength(“ui_up”)
input_vector = input_vector.normalized()

if input_vector != Vector2.ZERO:
	animationTree.set("parameters/idle/blend_position", input_vector)
	animationTree.set("parameters/walk/blend_position", input_vector)
	animationState.travel("walk")
	velocity = velocity.move_toward(input_vector * MAX_SPEED, ACCELERATION * delta)
else:
	animationState.travel("idle")
	velocity = velocity.move_toward(Vector2.ZERO, FRICTION * delta)
	
velocity = move_and_slide(velocity)

I figured it out. My Animation Tree was constantly setting my player to idle left if no input from the player was detected, but not if the game was running then it would just idle in whatever direction was last input if there was no player input.

I fixed it by turning my animation tree off during cutscenes I still don’t know why it want to idle left though

$AnimationTree.active = false

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.