i try use
var right = int(Input.is_action_pressed('d')) - int(Input.is_action_pressed('a'))
if right == 1 and scale.x != 1:
scale.x = 1
elif right == -1 and scale.x != -1:
scale.x = -1
if you press to the left, then other objects attached to this object begin to flicker from the left to the right, and if the object is to the left and you press to the right, then the attached object does not move to the right