0
\$\begingroup\$

I cannot import an .svg into a Unity project.

When I just move the .svg file into the Unity project Unity does not work with it and the only option Unity provides is to open the file (in my case it proposes me to open the .svg with Inkscape).

enter image description here

After performing a little bit of research I come to a conclusion that I need to have an SVG Package being installed into the Unity in order to import the .svg files.

But when I try to install the package I do not find it in the list of packages.

enter image description here

I am using a free Personal Edition of Unity. So, may it be that the option to import .svg is for paid version of Unity only?

Thank you.

Yes, it really seems that importing an .svg into Unity is only a paid feature. So, does anyone know about a way to import an .svg into Unity for free? For instance, are there other packages which help to accomplish this?

I do not see the needed package in the list of packages for preview: enter image description here

\$\endgroup\$
  • \$\begingroup\$ That wouldn't be a paid-only option. Try downloading the package and opening it. I don't have it with me at the moment, so I can't give details on how. \$\endgroup\$ – Almo Jan 23 at 21:31
  • \$\begingroup\$ @Almo, but one should pay in order to download the package... \$\endgroup\$ – iamyourfriend Jan 23 at 21:31
  • \$\begingroup\$ SVG is not a format that Unity understands natively. That means you can either use a library/package that adds this functionality (paying the authors for the use of it, if they've offered it as a paid asset), implement the functionality yourself, or convert the SVG to a format Unity does understand. We do not give tech recommendations here, so it's up to you to search for available libraries/packages and evaluate which ones meet your needs. But we can help you solve problems in implementing the functionality yourself or converting an SVG to another format, if you edit your question to ask this \$\endgroup\$ – DMGregory Jan 23 at 23:49
  • \$\begingroup\$ @DMGregory, is not this package free? And is not it is supposed to be incorporated into every Unity Editor of the version 2018.1 and later? \$\endgroup\$ – iamyourfriend Jan 24 at 14:58
  • \$\begingroup\$ Looks that way. Check out existing Q&A about how to install that package. \$\endgroup\$ – DMGregory Jan 24 at 15:28
1
\$\begingroup\$

If you want to use the Unity Vector Graphics preview package, make sure you check "Show preview packages" under Window > Package Manager > Advanced

With this, you should see the Vector Graphics package appears and can be installed.

Screenshot of enabling "Show preview packages" to show the Vector Graphics package

\$\endgroup\$
  • \$\begingroup\$ Can you confirm what version of Unity you're running? You may need to allow some time with an internet connection and a valid Unity account login for the new preview packages to be found and populated into the list. When in doubt, close & restart Unity, and contact tech support if the software still isn't working as documented. \$\endgroup\$ – DMGregory Feb 3 at 21:16
  • \$\begingroup\$ The Unity editor version which I am using is 2018.3.0f2. Which method would you advise for contacting the support? Thank you. \$\endgroup\$ – iamyourfriend Feb 4 at 0:43
  • \$\begingroup\$ Inside Unity, open the Help menu and select "Troubleshoot Issue..." — from there you can search for help on the issue and report a new issue to their support teams if it's not already covered. \$\endgroup\$ – DMGregory Feb 4 at 0:47
2
\$\begingroup\$

I would recommend to open the SVG image with an SVG editor (like the free Inkscape) and export it as a PNG (or other raster-oriented image format).

The drawback of this method is that you will lose the ability to scale the image infinitely without it becomming pixelated or blurry. But the advantage is that it will be a lot faster than solutions which rasterize the SVG in real-time. SVG is a very complex vector image format where many features have very hard to predict performance characteristics. So if you intend to use a lot of complex SVG images, then a runtime rasterizing solution might cause performance problems.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.