Writing simple mover, Unity engine crashes?

so i’m trying to make a gameObject > Quad to move left and right in an infinite loop

public class bossMover : MonoBehaviour
{
    public float speed2;

    void Start()
    {
        bossmover();
    }

    void bossmover()
    {
        while (true)
        {
            GetComponent<Rigidbody>().velocity = transform.right*-1 * speed2;
            if (GetComponent<Rigidbody>().position.x < -1.90f)
            {
                GetComponent<Rigidbody>().velocity = transform.right * speed2;
            }
            if (GetComponent<Rigidbody>().position.x > 2.11f)
            {
                GetComponent<Rigidbody>().velocity = transform.right * speed2;
            }
        }
    }
}

Unity Engine crashes when i run the scene(speed2 value 5).
Everything works just fine in the game instead of this script.

the while(true) will cause an infinite loop in the start function , unity does not like this so crashes. What you could so to stop the crashing would be to remove the while(true)and move the function call to Update()