Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

"infestation" spread in 2D top-down

Discussion in 'Editor & General Support' started by Wannabeuk, Nov 10, 2019 at 7:58 PM.

  1. Wannabeuk

    Wannabeuk

    Joined:
    Feb 19, 2013
    Posts:
    54
    So i'm looking to great an infestation element for my topdown 2D game, where an "spore" gameobject spreads infestation around itself. The idea being that left unchecked this would end up covering the entire ground of the map.

    I want to avoid using tiles for this, so i though about creating a dynamic mesh which i could grow in size/shape that would sit just above the tilemap so it would draw ontop of it (I'm using the tilemap only for visuals)

    I don't know a huge amount about creating and manipulating a grid from code, i've seen very basic examples online. But my issue is that i would want this mesh to abide by terrain, such as either not going over cliffs, or being slower to spread over cliffs.

    First of all, is this something that is possible, or at least not extreamly difficult to do?

    If so could anyone give and suggestions on how to go about something like this?
     
    Last edited: Nov 10, 2019 at 11:38 PM
  2. Wannabeuk

    Wannabeuk

    Joined:
    Feb 19, 2013
    Posts:
    54
    Updated the post to be more clear (hopefully)
     
  3. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    6,173
    You have posted in wrong forum section.
    You should post in
    Game Design
    You can request via report, to move there.

    If you have uneven terrain, you run into complex problem.
    It would be some form of procedural algorithm.
    Easier would be to control multiple smaller meshes.
    Or each tile. But any reason you wan avoid tails?

    Alternatively, use shader to draw spread of infestation.
     
    xVergilx likes this.
  4. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    2,013
    Add a shader that draws texture on top of the object.
    Alter alpha of that map based on your desired condition.

    I think that's how Starcraft did the creep in its time.