Sprite.Create makes invisible sprites, even when nothing is changed.

In my game, I want my player to display one of two sprites.

 //spr is a public Sprite variable
 if (hasAltCostume) {
          //this code will be replaced by something more complicated later
          GetComponent<SpriteRenderer> ().sprite = Sprite.Create (spr.texture, spr.rect, spr.pivot);
} else {
          GetComponent<SpriteRenderer> ().sprite = spr;
}

When hasAltCostume is false, the code works fine. When it’s true, the player is invisible.

What’s going on? Shouldn’t Sprite.Create(spr.texture, spr.rect, spr.pivot) just be a clone of spr?

Never mind, I figured it out- sprite.textureRect is the rect that should be used, not sprite.rect. Similarly for sprite.pivot.