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

Rendering an AOE area?

Discussion in 'Scripting' started by Dydra, Nov 16, 2011.

  1. Dydra

    Dydra

    Joined:
    Dec 26, 2010
    Posts:
    53
    Hi! I am making a top down shooter and I need to implement area of effects skills. I have tried using a projector to render an image over the "ground" but couldnt make it work... any ideas?
    Ty for ur time
     
  2. Xsnip3rX

    Xsnip3rX

    Joined:
    Aug 29, 2009
    Posts:
    197
    One thing you could try is a Plane with a Soft Particle Material.
     
  3. Dydra

    Dydra

    Joined:
    Dec 26, 2010
    Posts:
    53
    the problem is that my floor isnt flat... i am using spheres, like the game Stardust HD.
     
  4. chris64

    chris64

    Joined:
    Sep 27, 2011
    Posts:
    72
    For sure using a projected texture is what I would do. There's a shadow projection in the standard asset library. It seems like it could be modified pretty easily but I'm using it and it works exactly as you would expect. The only tricky part was that it casts down on your players as well so you need to move them to a separate layer and add that as an exempt layer within the projector.

    Hope that helps.
     
  5. Dydra

    Dydra

    Joined:
    Dec 26, 2010
    Posts:
    53
    not sure w ur talking about. could you explain it a lil bit? ty
     
  6. chris64

    chris64

    Joined:
    Sep 27, 2011
    Posts:
    72
    If you import the standard assets it includes a thing called a blob shader. It is essentially a projector that projects an image (a black gradiant blob). It conforms to shapes excellent. The black shape could easily be replaced with something more colorful and AOE appropriate. My Update routine just positions this blob over my players head with about a +5.

    Play with that and it will get you started. It was very easy to add. Once you get it working you'll see the problems I was talking about - it projects right on your players as well which is probably not desired. You can correct this by moving things to layers (an option in the properties window). You create a layer called "whatever," then change all your assets to this layer that you don't want to be projected on. Finally you go to the properties of you projector and add "whatever" to your exempt layers property (I'm going off of memory it's probably called something else.)
     
  7. Dydra

    Dydra

    Joined:
    Dec 26, 2010
    Posts:
    53
    perfect, just used w u said and works perfect. One more thing i would luv to know: is there a way to prevent lights from bluring the img I am projecting? Ty so much


    edit: let me change the question. How do I change the material properties (for example, transparency)? When I try using a different material from Projector>Light the whole plane becomes affected by the texture (not only the circle i am interested in),
     
    Last edited: Nov 17, 2011