Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at during this transition time.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.

    Read our full announcement for more information and let us know if you have any questions.

Feature Request Create Image when dragging Texture asset under Canvas, instead of Sprite Renderer

Discussion in 'UGUI & TextMesh Pro' started by huulong, Sep 5, 2022.

  1. huulong


    Jul 1, 2013
    Currently, to create an Image with a certain Texture under a Canvas, you must 1. create a new Image 2. select or drag the Texture you want.

    Sprites (as well as Meshes and other common objects associated to an asset) have a nice shortcut where dragging the asset on the scene (view or hierarchy) creates a game object with a relevant component linking to the asset.

    It almost works for Images, except Unity doesn't understand the context of being under a Canvas and will systematically create a Sprite Renderer with the texture, instead of an Image.

    While I acknowledge some edge cases where you'd want a Sprite there, in most cases we really want an Image under Canvases. Would it be possible to add an Image when a Canvas is detected on any parent (direct or indirect)? If this breaks expected behavior for users who really need sprites, could this at least be an option in Editor settings? (although I think you should make it enabled by default, and let users who prefer the old behavior disable it)