Inkscape.org
Beginners' Questions What SVG format is compatible with Unity?
  1. #1
    KiloJKilo KiloJKilo @KiloJKilo

    I have been using other people's SVG sprites in unity for some time. Never had a problem with a single one. I started making assets in inkscape but cannot seem to use them in unity. I've tried saving them in plain, and optimized format but unity gives me errors. Is there something I should be changing in the optimization window when 'save a copy'?

    For reference, the unity error is:

    KeyNotFoundException: The given key was not present in the dictionary.
    System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <437ba245d8404784b9fbab9b439ac908>:0)
    Unity.VectorGraphics.SVGDocument.ResolveReferencedNode (Unity.VectorGraphics.SceneNode referencedNode, Unity.VectorGraphics.SVGDocument+NodeReferenceData refData, System.Boolean isDeferred) (at Library/PackageCache/com.unity.vectorgraphics@2.0.0-preview.12/Runtime/SVGParser.cs:1301)

    All other SVGs I've ever used have no issue importing.

  2. #2
    Martin Owens Martin Owens @doctormo🌹🧀

    That's a hard one, because the issue is with Unity, but the error message isn't any good so we don't know /why/ it's failing.

  3. #3
    KiloJKilo KiloJKilo @KiloJKilo

    I decided to try importing the SVG into an online editor and seeing if I could save it and import that SVG into unity. That online editor couldn't even open the SVG. So I started thinking about what made my instance unique..and it dawned on me. I'm actually using the seamless pattern template. That's the issue. I copied the layers into a normal SVG and boom, it imported. In the past, I had been exporting PNGs out of the seamless pattern creator so the issue didn't immediately stand out.

Inkscape Inkscape.org Inkscape Forum Beginners' Questions What SVG format is compatible with Unity?