Hframes cannot be smaller than 1 error

Godot Version

v4.3

Question

I keep getting this error message when my slime enemy attacks my character then transitions to idle/walk.
image

I have no idea if its an animation tree error or an error in how I’m doing my animation transitions via code. This is how I handle animations



This is my animation tree. Any information is helpful

I think you have to make sure that this property doesn’t get smaller than 1.

hframes: Sprite2D — Godot Engine (stable) documentation in English

set_hframes: Amount of hframes cannot be smaller than 1.

maybe similar issue: Encountered an issue "set_frame: Index p_frame = 17 is out of bounds" with higher version when trying to upgrade Godot from 4.1.1


Is it always reproducible?
If you can share your project then I could try to debug it later when I find time.

I understand the error I just don’t know what is setting the property smaller than one. No where in my code am I manually setting the hframes property its all done via the animation tree/player. It is always reproducible when my slime enemy is swapping between animations.

How can I share my project?

I have fixed this problem. I just deleted my animation player and animation tree and recreated them and the problem has gone away. No idea what the issue was

1 Like

For example on Google Drive, not possible here in the forum.

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