Drag and Drop on Fields with preview-field attribute doesn´t work

Issue #335 resolved
Former user created an issue

Hi, i made two fields with previewfield attribute- one for a sprite and one for a prefab. On both i can´t drag and drop things. On Sprite field - Drag and Drop a sprite Image - nothing happens - Drag and Drop a png - Unity crashes On GameObject(Prefab) field unity crashes when putting a prefab on it.

With select function from the preview window it works to select things but thats of cause a horrible workflow.

I´m on OSX, Unity 2017.3f

Comments (10)

  1. Chase Florom

    Hey, I’m still having this same problem. Seems like a really bad workflow, should be able to drag & drop.

  2. Tor Esa Vestergaard

    Could you clarify the exact reproduction steps needed to cause this issue to appear? Drag and drop seems to work fine for PreviewField as far as I can tell, and the above steps do not seem to reproduce for us. Which OS is it on, which Unity version, etc. etc., and is it globally or only in certain scripts?

  3. John Stock

    This does not work 3.0.12.0 and Unity 2020.2.7f1 on W10.

    The field in the inspector is “[SerializeField] [PreviewField(150)] public Sprite ImageAndIcon;”

    The Sprites I’m trying to d&d is marked as “Sprite (2D and UI”

    I have to click the “Select” button and then search for the Sprite rather than drag n dropping it. So they are all the right types etc.

    This has been an issue since 2018 sirenix / Odin Inspector / issues / #372 - Remove extra steps to sprite assignment when using the PreviewField attribute. — Bitbucket

  4. leo mak

    How could it be resolved when it doesnt work.
    I have an array of sprite pairs.

       public class FeedItSpritePair
        {
            [PreviewField]
            public Sprite animal;
    
            [PreviewField]
            public Sprite food;
        }
    

    And I cant drag and drop sprites. I’m able to do it without preview attribute applied.
    Unity 2021.1.7f1

    This is what I have in editor. I cant drag sprite here. I had to click on picture and select from list.

  5. GMonks Developers

    There is a way to use drag and drop feature for sprites by using “filter by type” button next to the search field in the project tab. This is not an exact solution but at least it will do the job.

  6. Antonio Rafael Antunes Miranda

    The drag and drop issue is fixed and will be distributed in the next Odin release (Current: 3.0.13.0).

    As for the crashes, I could not reproduce it with the provided information.
    Feel free to reopen this ticket if you’re still encountering crashes and share the necessary reproduction steps.

  7. Log in to comment