A downloadable C# Script

Download NowName your own price

A simple C# script to add an outline to your sprites. This can be useful for making your characters and other sprites have a more defined shape from the rest of your environment. The outline appears and changes shape in real time as the sprite you are outlining changes, both in the editor and in playmode.


HOW TO USE

- Import the script into your Unity project.

- Be sure all textures you are outlining have "Read/Write Enabled" on in their import settings.

-  Right-click on the sprite you want to outline, then select "2D Object > Sprite" to create a new sprite as a child.

- Rename this sprite to "Outline".

- Attatch the outline script to the new sprite, and drag and drop the parent as the "Renderer To Outline" variable.

- Set the color of the outline.

- Enjoy!


LINKS

Make a donation, amount of your choosing!

https://paypal.me/copaardvarkdonation?locale.x=en_US

Support me on Patreon

https://www.patreon.com/copperaardvarkgames

LudumDare account page:

https://ldjam.com/users/copper-aardvark-games/

Procedural Dungeon Generator for Unity:

https://copper-aardvark-games.itch.io/procedural-dungeon-generator

Pixel Perfect Camera for Unity:

https://copper-aardvark-games.itch.io/pixel-perfect-camera

My LudumDare 44 Entry:

https://copper-aardvark-games.itch.io/kill-the-money-demo

Problems, questions, comments, contact me:

Via email: thatcopperaardvark@gmail.com

Via SMS: 830-446-0760

Download

Download NowName your own price

Click download now to get access to the following files:

Outline.cs 4 kB

Comments

Log in with itch.io to leave a comment.

I can't use it. Could you make a video about the process? There's a problem with adding it to the sprite. I can't see result. 

(1 edit)

It seems i uploaded a new script with a personal change to it for a specific project. I've updated the script, try downloading the new one.

Since I don't know your specific problem, here are a few problems that may be occuring and their solutions:

- Make sure you're not applying the outline script on the gameobject you want to outline. Be sure its a child of the object, and has the parent assigned as "Renderer To Outline."

- Make sure the alpha level on the color of the outline isn't at 0. By default, it is.

- This script is meant for outlining very small textures, ideally nothing larger than 256x256. otherwise the outline would be very small. The script only creates a one pixel thick outline.

- Be sure that on the texture's import settings, under "Advanced", "Read/Write enabled" is set to true.

If you are still having issues, let me know.

Thanks!