rb.constraints = RigidbodyConstraints2D.FreezePositionX; rb.constraints = RigidbodyConstraints2D.FreezePositionY;