Unity crashing and LocalScale not working

Hi, so I’m trying to get the my enemy and player sprites to flip whenever they face the other direction. Right now, I have it just use the negative of whatever the player or enemies change direction. The only thing is, it isn’t working and it is crashing unity anytime I play. I you could help me out, I’d greatly appreciate it!

	public bool FacingRight = true;
	public float Righty = 1f;
	public float Lefty = 1f;

		void Update ()
		{
				if (transform.rotation.eulerAngles.z > 90 && transform.rotation.eulerAngles.z < 270 && FacingRight == true) {
						FacingRight = false;
						transform.localScale += new Vector3 (transform.localScale.x, transform.localScale.y, transform.localScale.z);
				} 
				if (transform.rotation.eulerAngles.z < 90 || transform.rotation.eulerAngles.z > 270 && FacingRight == false) {
						FacingRight = true;
						transform.localScale += new Vector3 (transform.localScale.x, transform.localScale.y, transform.localScale.z);
				}
		}

I didn’t catch this before but the problem was that the

transform.localScale += new Vector3 (transform.localScale.x, transform.localScale.y, transform.localScale.z);

should have been

transform.localScale = new Vector3 (transform.localScale.x, transform.localScale.y, transform.localScale.z);

Just that simple little +. I should be more careful.