Search Unity

making smoke particles, multiple instantianting

Discussion in 'Scripting' started by Gaba, Nov 18, 2009.

  1. Gaba

    Gaba

    Joined:
    May 29, 2009
    Posts:
    41
    Im making this script which objective is to make smoke start in the middle and slowly enter trough doors and spaces. you guys can feel free to use it.


    I got it almost right, except the part that i don't want to put an emmiter where there is already one. I decided to check if there were any emmiters in the same position as the old ones, but even if they are in the same position, the condition simply isn't met. EVER.

    so, some help please? i think it may be on the remakeArrays method, also, i noted i only effectively blocked a new object from placing when they are the thisRing array, so maybe there as well?

    So, any suggestions? this looks very much like a pathfinding algorithm, so if any of you got any experience in that kind of stuff maybe?


    thanks guys!
     

    Attached Files:

  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    Probably the best thing to use here is a flood fill algorithm. There are similarities between this and the A* algorithm, but there is no actual path to be recovered here, as such.
     
  3. Gaba

    Gaba

    Joined:
    May 29, 2009
    Posts:
    41
    Thanks! I'll dive a bit into the the algorithm and try it

    guess i was reinventing the wheel eh? That's what i get for not having studied computer science