Invalid assingment of property or key

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

Small mistake in last line, auto completion can help you to figure out syntax.

animated_sprite.offset.x = 2

thanks!
i copied your line and put it in mine and it works but i cant tell what the difference is?
oh nevermind im very stupid. its the dot instead of the underscore. thank you