Godot v4.3.stable
Beginner here
Trying to do apply some basic animations to my animated sprite, and i noticed my sprite was not centered, so i changed the offset x to -2 pixels in the inspector which fixed it. But when i flip my character to face the other way, i need to also flip the value of the offset so the animation lines up with the collisionshape.
@onready var animated_sprite: AnimatedSprite2D = $AnimatedSprite2D
if direction < 0:
animated_sprite.flip_h = true
animated_sprite.offset_x = 2
The flipping works just fine, but the last line gives error: Invalid assingment of property or key ‘offset_x’ with value of type ‘int’ on a base object of type ‘AnimatedSprite2D’
what i dont understand is why does this work for the flip_h but not offset_x
probably a very basic problem to have, but thanks in advance