From hierarchy to prefab: prefab loses its sprite

I’ve managed to create an object in the hierarchy automatically when I import a texture.

However, as soon as it becomes a prefab, it doesn’t have its sprite attached to it anymore.
Here’s the bug shown in a gif:

Explanation of the gif:

  • I import a texture, it creates a prefab(no sprite) + an object in the scene(with sprite).
  • so I drag the scene object into my folder and it still loses its sprite.

It’s really a weird thing, does someone know why this occurs?

If your sprite is an Instance and not a reference to a Sprite Asset then this will happen as a prefab cannot save a reference to an instance of something the same way you cannot set a prefab gameObject reference to an object in a scene.

That would be my guess. but it’s hard to know form that gif.

Oh yes, that must be it. Thank you.