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

Booooooooooooooooooom!!!!

Discussion in 'Scripting' started by MetroidHunter, Jul 25, 2007.

  1. MetroidHunter

    MetroidHunter

    Joined:
    May 22, 2007
    Posts:
    213
  2. Randy-Edmonds

    Randy-Edmonds

    Joined:
    Oct 10, 2005
    Posts:
    1,122
    dude, you're scary. :wink:
     
  3. MetroidHunter

    MetroidHunter

    Joined:
    May 22, 2007
    Posts:
    213
    Ka-Boooooooom!
    Ka-Boooooooom!


    Blow it up!


    ...So how do I do this?
    :wink:
     
  4. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    It's difficult, but I would suggest at least four particle systems. One that does the fireball, one that does the shockwave kicking up dust on the ground, one that does the column of smoke, and another for the mushroom part. Those will mostly be fairly simple, except for the top of the mushroom cloud. You'll need to figure out how to make it roll as well as follow the top of the column. To do this properly, you'll want to get a script to move them using ParticleEmitter.particles
     
  5. MetroidHunter

    MetroidHunter

    Joined:
    May 22, 2007
    Posts:
    213
    Ooookay. What the heck does that do?
     
  6. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    Tip: the docs are there to help you (start here, look for other related links including the one Muriac provided)
     
  7. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    I've tried to make that cloud for almost 2 months.
    First you need to start out with a single element, the base. You have to know how to first programatically create objects to house the particle emitters. The base cloud that travels along the ground is really a single triangle mesh with a smoke effect and a direction.

    Now, there is a limit to entities, so you need to figure out how to use the standard asset of combine child objects and chain a bunch of meshes you generate together as children as they are created and combine them.

    However, this is MY fuzzy logic :)
    Flat out I am insane on how I code, since I code with a base on the chaso theory

    Anyway, This would be a WHOLE lot easier if unity had a donut as a base object. Then you could stretch the donut for the base. The cloud growth itself could be an altered cylinder. The top, again, a donut with a cap of a sphere. The donut and sphere could grow as the particle emtters emmit.

    However, right now, Unity doesn't have a donut as a basic item. I use Hexagon 2, which has the ability to create an object that represents the center of the cloud. I can then stretch that object. Its the base and top I have issues with.

    Anyway, its totally possible, just alot of math and movable objects.
     
  8. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    I'm not sure how that makes things easier...surely it is trivial to model a donut and import it? At least with Blender it takes a few seconds.

    --Eric
     
  9. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    No need to use external application to design it:)
    I like using the built in primitives, I am guaranteed they will work :) but your right, blender, or whatever can create it, then put it in assets, then apply it to a prefab, then use it.
     
  10. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    I posted some code to generate a growing explosion envelope the last time Samus asked this question, along with an explanation of what it was doing:-

    http://forum.unity3d.com/viewtopic.php?t=5835

    Attached to this post is a slightly modified version of the script that gives a greater billowing effect to the explosion. Try with MaxNumLevels=15, ExpansionAngle=0.1, TopAddition=1, Delay=10, TimeBetweenFrames=0.005, Lift=0.02, NoiseLevel=5 (the other parameter only affects a bit of code that is commented out in this version of the script).

    The main tweakable things here are the expansion angle and the maximum number of levels. If you increase the number of levels, you get a bigger but smoother explosion unless you also reduce the expansion angle slightly. (Not very scientific, I know - the behaviour is probably a bit too chaotic.)

    Try running the script with a simple MeshRenderer and lift set to zero to get a better visual impression of what the code is doing. Then, replace the mesh renderer with the particle emission stuff and a fiery texture to get the explosive effect.

    The toroidal dust cloud at the base can be achieved using similar geometry. In fact, you could possibly get away with a little circle of these explosion objects, each with a dust cloud texture and their "up" direction set to point away from the main explosion (so that their "lift" carries them along the ground).
     

    Attached Files:

  11. MetroidHunter

    MetroidHunter

    Joined:
    May 22, 2007
    Posts:
    213
    WHAT is the class name. C Sharp only works if I have the !#*$ class name! :x
     
  12. hsparra

    hsparra

    Joined:
    Jul 12, 2005
    Posts:
    750
    The class name is Explosion. Make sure the script is also named Explosion.