edge detection on select object

Hi guys,

I am working on a non-game application with unity and I am still learning unity.

I am working on a visual effetc for selected object; when the object is selected it became:

  1. semi-transparent (alpha 50%)
  2. black lines are displayed over edges (edge detection)

I have big problems with edge detection.
Please, can anyone give me some help to create this feature?

Thanks in advance.
Kenshin

For the edges you could investigate the toon shader and material. That has an option for outlining. Perhaps load that shader when you need it.

For transparency this might work (untested):

// Set main color to 50% transparency
renderer.material.color.a = 0.5;

to set the alpha (transparency) for 50%.

here’s color.a:

here’s another useful reference for color transparency:

Thanks for your help Vimalakirti!