Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Add glowing ring around the selected enemy

Discussion in 'Editor & General Support' started by JasonWIR, Apr 26, 2011.

  1. JasonWIR

    JasonWIR

    Joined:
    Mar 7, 2011
    Posts:
    84
    How can you put a glowing ring around the selected enemy? Right now I am using a flattened cylinder with a self-illuminated shader, but it is a little awkward especially when the terrain isn’t flat.

    I have heard someone before say try using a projector above the player, but that turned everything in a square mile (exaggerated for effect) red no matter how small I tried to make it.

    Anyone done this before?
     
  2. ChaosWWW

    ChaosWWW

    Joined:
    Nov 25, 2009
    Posts:
    470
    It should be a projector, as they wrap to the terrain perfectly. I don't know why you have issues with the projector, it should work if you set your texture to clamp instead of repeat and make sure there are like 3-5 black pixels on every side of your image.
     
  3. JasonWIR

    JasonWIR

    Joined:
    Mar 7, 2011
    Posts:
    84
    Thanks. Assume I know nothing about projectors!

    Do I add an image that looks like a ring that is transpartnet in the middle, and black around the edges?
     
  4. pinkhair

    pinkhair

    Joined:
    Dec 17, 2010
    Posts:
    141
    Yes, exactly.
     
  5. JasonWIR

    JasonWIR

    Joined:
    Mar 7, 2011
    Posts:
    84
    Even when I make my Field of View something small like 8, it lights up almost the entire map!! Also, I do not see a clamp.
     
  6. JasonWIR

    JasonWIR

    Joined:
    Mar 7, 2011
    Posts:
    84
    I have my projector shining straight down hovering about 3 meters in the air. Here are my settings:
    + Near Clip Plane 0.1
    + Far Clip Plane 8
    + Field of View 15
    + Aspect Ratio 1
    + Orthographic false
    + Ignore all layers except terrain

    Still it ignored my image and lights up half the map. Perhaps I have something bugged.
     
  7. Quietus2

    Quietus2

    Joined:
    Mar 28, 2008
    Posts:
    2,058
  8. JasonWIR

    JasonWIR

    Joined:
    Mar 7, 2011
    Posts:
    84
    The projector allows me to add a Material not a Texture2D.
     

    Attached Files:

  9. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Read the docs.
     
  10. JasonWIR

    JasonWIR

    Joined:
    Mar 7, 2011
    Posts:
    84
    @hippocoder: Err...I would love to see some Docs. Do you know of any that will help? Please link them.

    @Quietus I have my Texture2D of my image set to clamp that my material is using. My projector still is showing WAY out of its assigned range. It is also showing a solid black, which I suspect is the color for transparencies. when I change the Shader to Transparent/Diffuse the image is not there at all.
     
  11. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    You need to change the shader to projector multiply (under "FX" I think).
     
  12. JasonWIR

    JasonWIR

    Joined:
    Mar 7, 2011
    Posts:
    84
    Multiply is under Particles, but had no effect. :(

    My projector will not show the image at all. Either it shows nothing or it shows a solid color across the screen on the terrain. I can put the material on anything else and it shows fine.
     
  13. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    I don't use projectors so I'm not sure how they work, but do you need data in the alpha channel of the texture? like black in the centre and white on the ring maybe.
     
  14. HarvesteR

    HarvesteR

    Joined:
    May 22, 2009
    Posts:
    530
    Projectors are picky about their textures...

    First, make sure the texture asset is marked as "clamp", else you will get a repeating pattern all over the scene...
    Then, create a material and give it a projector shader... They are all under "projector" on the shader list.

    These shaders have two texture slots, one for the actual image that will be projected, and another for a falloff map.
    The falloff map is a grayscale image, that is usually a gradient from white to black, going from left to right in the image.

    You dont have to make this falloff texture though, unless you're going for a custom effect... There is a good falloff map in he standard assets/projectors folder.

    With the projector material set, you can drop that material in the projector's material slot.

    With those things set, the projector should work alright ;)

    Cheers
     
    Last edited: May 5, 2011