Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

2D Outline [RELEASED]

Discussion in 'Assets and Asset Store' started by dude4004, Nov 28, 2016.

  1. dude4004

    dude4004

    Joined:
    Jul 15, 2014
    Posts:
    183
    Hello there,

    Ever wanted to add a simple outline to many sprites at once and have them all outlined as ONE sprite?
    This package is for you.



    Easy solution to handle 2D Outline on sprite.
    Demo Package Link
     
    theANMATOR2b likes this.
  2. dude4004

    dude4004

    Joined:
    Jul 15, 2014
    Posts:
    183
    It has been accepted recently.
    If you have any question or a request, post it here OR send a email to volkov40@hotmail.com
     
  3. dude4004

    dude4004

    Joined:
    Jul 15, 2014
    Posts:
    183
    Just fixed a minor bugs with the latest build of Unity.
    Patch should be ready on unity store in a few days.

    Best regards,
     
  4. jonimikkola86

    jonimikkola86

    Joined:
    Mar 23, 2016
    Posts:
    5
    Hello and thanks for the plugin!

    I have just one short question, why does the outline show upside down? I post it here in case someone has similar problems.

    It seems that if I move the character left or right, outline will follow but if I move it top or bottom, outline moves in opposite direction.

    Screen Shot 2017-02-16 at 10.40.47 AM.png

    Thanks in advance,
    -Joni
     
  5. dude4004

    dude4004

    Joined:
    Jul 15, 2014
    Posts:
    183
    Thanks ;)
    Does it happen when you use the Play button OR when you build your project with the WebGL?

    Best regards,
     
  6. jonimikkola86

    jonimikkola86

    Joined:
    Mar 23, 2016
    Posts:
    5
    Thanks for reply!

    I opened a new 2d project with Unity version 5.5.1f1 and then imported Outline2D plugin and opened demo scene. I'm running Unity on OS X.
    Screen Shot 2017-02-17 at 8.43.43 AM.png

    -Joni
     
  7. dude4004

    dude4004

    Joined:
    Jul 15, 2014
    Posts:
    183
    Oh,

    Could you try this?
    Find the file Resources->Mats->OutlineShader, open it up.

    then add this line

    uv.y = 1 - uv.y;


    It should do the trick.
     
  8. jonimikkola86

    jonimikkola86

    Joined:
    Mar 23, 2016
    Posts:
    5
    I already had that line in my script file. I then commented it out and it outlines seem to show up now nicely!
    Thanks!
     
  9. ciapoide121

    ciapoide121

    Joined:
    Aug 30, 2014
    Posts:
    10
    Hi,

    does the outline only work with GameObjects with SpriteRenderer component, or it also works with meshes such as Spine objects?

    thanks !
     
  10. a0100101

    a0100101

    Joined:
    Feb 9, 2014
    Posts:
    15
    Hi, is this shader mobile ready?
     
  11. svkotelnikov

    svkotelnikov

    Joined:
    Jun 25, 2017
    Posts:
    2
    Hi all! I have problem with apply this plugin to spine skeleton animation (picture attached), does someone have ideas how to fix this?
     

    Attached Files:

  12. dude4004

    dude4004

    Joined:
    Jul 15, 2014
    Posts:
    183
    Is this a sprite or a mesh?
     
  13. svkotelnikov

    svkotelnikov

    Joined:
    Jun 25, 2017
    Posts:
    2
    This is a set of meshes. With different shaders of character I have the same result: some bones have a square outline and i don't know why.

    I use unity 5.6.0f3 and last spine version 3.6.37 (http://esotericsoftware.com/)
     

    Attached Files:

  14. dude4004

    dude4004

    Joined:
    Jul 15, 2014
    Posts:
    183
    I'm sorry but this package only work with SpriteRenderer.
    I could find a way to make it work with Mesh, but not at this moment

    sorry
     
  15. dude4004

    dude4004

    Joined:
    Jul 15, 2014
    Posts:
    183
    I just updated the Outline, now you will be able to choose to apply the Outline to 1x sprite OR 1x sprite and all it's childs.

    All you need to do is to use this new variable on the Outline script : OutlineAllChilds
    best regards,
     
  16. Spetz_

    Spetz_

    Joined:
    Jul 9, 2014
    Posts:
    2
    I can't get it to work. The demo scene works, and when I add a sword to my own scene it works. But it doesn't work on my own sprites. My sprites were just PNGs. They also have a parent.
     
  17. dude4004

    dude4004

    Joined:
    Jul 15, 2014
    Posts:
    183
    Can you send me a little copy of a sample project so I can see it by myself to volkov40@hotmail.com?

    I will gladly look at it and tell you what to do.

    best regards,
     
  18. Spetz_

    Spetz_

    Joined:
    Jul 9, 2014
    Posts:
    2
    I got it working now. Not sure what went wrong earlier. Thanks anyway.
     
  19. dude4004

    dude4004

    Joined:
    Jul 15, 2014
    Posts:
    183
    Your welcome :)
     
  20. trilobit

    trilobit

    Joined:
    Feb 17, 2015
    Posts:
    2
    Hi, Is there a way to make outlines work form UI images? They do not have Sprite Renderer component but Canvas Rendrer. When I try to add Outline script to UI Image not supported Renderer error happens.
     
  21. dude4004

    dude4004

    Joined:
    Jul 15, 2014
    Posts:
    183
    Not currently, but I could add this request.
    I'll see what I can do.
     
  22. mickeymicks

    mickeymicks

    Joined:
    Jun 30, 2014
    Posts:
    1
    Hi,
    I seem to be having trouble using this in a sprite on an existing project. When i hit "Play" the outline appears momentarily and then just disappears. It's also pink.
    Outline is set as "Always".
    I have a feeling it might be a setting on the camera or materials that i might have missed because using this on a newly created project works just fine.

    Is there any special setting that i need to do?
    Thanks for the help.
     
  23. dude4004

    dude4004

    Joined:
    Jul 15, 2014
    Posts:
    183
    Do you have errors?
     
  24. JoJorge

    JoJorge

    Joined:
    Jan 24, 2018
    Posts:
    1
    I have the same issue as #22. In my case, I found that it will not work if I add another unity package called "Unity Anima2D". Maybe Anima2D modify the behaviour of SpriteRenderer and then disable the outline? Do you know anything about the possible reasons?
    Thanks
     
  25. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    260
  26. LootFox

    LootFox

    Joined:
    Dec 3, 2018
    Posts:
    1
    Is there any way to get this shader to work with more colors??? I seemed to be able to get a dark orange to work by changing the variables in the manager script, but generally speaking weird behavior occurs if I try different color values. I'm a bit confused by these lines in the shader too. :



    if(outlineSource.a < h)
    {
    if (sample1.r > h || sample2.r > h || sample3.r > h || sample4.r > h)
    {
    outline = _LineColor1 * _LineIntensity;
    hasOutline = true;
    }
    else if (sample1.g > h || sample2.g > h || sample3.g > h || sample4.g > h)
    {
    outline = _LineColor2 * _LineIntensity;
    hasOutline = true;
    }
    else if (sample1.b > h || sample2.b > h || sample3.b > h || sample4.b > h)
    {
    outline = _LineColor3 * _LineIntensity;
    hasOutline = true;
    }
     
  27. dude4004

    dude4004

    Joined:
    Jul 15, 2014
    Posts:
    183
    no, this is the current limit.
    You can only have 3x color with this.

    Sorry.
     
  28. UnetDev

    UnetDev

    Joined:
    Aug 28, 2017
    Posts:
    53
    Hello! Why are links not working?
    Could you please update them?
    It looks like the asset has been disabled. Can I get it in the mail?
     
    Last edited: Sep 6, 2019
  29. UnetDev

    UnetDev

    Joined:
    Aug 28, 2017
    Posts:
    53
    Is the topic dead?
     
unityunity