godotengine / godotengine/godot

Animation wont play during runtime.

Open
#98,581 5 comments 0 reactions 0 assignees View on GitHub
bug confirmed needs testing topic:animation
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Reproducible in v4.3.stable.official [77dcf97d8]

### System information

Godot v4.3.stable - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4070 (NVIDIA; 32.0.15.6094) - 13th Gen Intel(R) Core(TM) i7-13700KF (24 Threads)

### Issue description

For the last week I've been pulling my hair out on why this one state machine is broken. I've deleted it, remade it, renamed it, done everything I can and for some reason it will not play some animations. There is a player scene with an animation tree in it with a state machine. This state machine has two more state machines inside it, one is the moving state machine and the other is the attacking state machine. These systems have been removed from the MRP and are just traveled to and from using some basic code. Inside the attacking machine is where the problem lies. The attacking machine is supposed to play an attack animation, and then at the end, a returning animation in which the player can move to get out of it. Unfortunately, the two states in there play just one animation, if I switch it to anything but the "Baked_Player_Blunt_Wep_Small_Attack_1" animation, it will not play ( technically it does but it stays at frame 0, according to the playback). However, this only occurs after switching the animation of those states by code. Setting them in the editor prompts them to work just fine, as long as they aren't tampered by the code. BUT, this only applies to any other animation than the one I listed earlier, "Baked_Player_Blunt_Wep_Small_Attack_1". Setting both states to that animation via code works perfectly fine. This has been frustrating, to say the least.

### Steps to reproduce

In the MRP below, I've ripped out about 95% of the project and this still persists, yet for some reason, I can't get this situation to occur when creating a project from scratch.

### Minimal reproduction project (MRP)

[MRP.zip](https://github.com/user-attachments/files/17534374/MRP.zip)

Contributor guide

Open the contributing guide

Research direction

Start by opening the attached MRP.zip in Godot v4.3 and reproducing the AnimationTree state-machine behavior described in the issue. Inspect the nested attacking state machine and the code that changes its animations, comparing those results with animations assigned in the editor. Done means identifying why the affected animations remain at frame 0 and confirming the fix in the MRP.

Written by the indexing model from the issue text.

Assessment

Tech stack
godot
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.