To keep it simple, you can give your character the 8Direction behavior, then in the behavior properties you can set "Directions" to "Left & right". Also in the behavior properties, change "Set angle" to "No" so that the behavior doesn't change the object's angle.