Nickolay Kabash
Nickolay Kabash

Reputation: 67

Unity3d Silhouette Highlight for 2d sprite

I want to implement Silhouette Highlight on MouseOver like in this picture:

Example

Built in Unity3d user interface elements have a component called Outline and Shadow, but they only work with the user interface, not with the SpriteRenderer. The first idea was to create a second sprite with highlight at background and enable it to MouseOver, but I think that this method is not good.

Upvotes: 1

Views: 2107

Answers (1)

Fattie
Fattie

Reputation: 12582

As Everts (and me) mentions in a comment,

there's nothing wrong with simply making the "glow sprites" and turning them on and off. That would certainly be done in many large games: it's good.

It's true that you could write a shader that does this, but really that would be "bad engineering" - totally unnecessary for such a simple need. (And to be clear, arguably it's plain better to make custom sprites.)

Now, this brings us to an important point about Unity engineering -

it's critical to use existing assets, in Unity work.

There are a couple of stand-out examples. Like, NatCam and Edy's vehicle system. You just - literally - cannot use the camera in a game unless you use "NatCam"; the only alternative would be to completely pointlessly spend a year building NatCam yourself.

In this case, there are many good "glow shaders" available ...

https://www.assetstore.unity3d.com/en/#!/content/20166

Enjoy!

enter image description here

Upvotes: 2

Related Questions