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

[RELEASED] Exploder 2D: realtime sprite explosion system

Discussion in 'Assets and Asset Store' started by reindeer-games, Nov 3, 2015.

  1. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hello everyone,

    I would like to announce a new store product Exploder 2D: Realtime sprite explosion system.

    logo.png


    Exploder 2D is a realtime sprite explosion system for Unity. It can explode any Unity sprite object in a matter of milliseconds! Just tag your favorite game object and call method Explode from the script. It comes with tons of settings and adjustments based on original mesh Exploder package.

    Exploder 2D is a younger brother of original Exploder package. The core algorithm was greatly simplified and optimized for 2D processing. It results in excellent performance and smaller memory footprint on mobile devices.

    Web Demos:

    Platformer Demo
    Click and Explode Demo
    Android APK

    Documentation






    Link to store:
    https://www.assetstore.unity3d.com/en/#!/content/44531


     

    Attached Files:

    • logo.png
      logo.png
      File size:
      125.8 KB
      Views:
      1,475
    theANMATOR2b and Gozdek like this.
  2. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    Fantastic system !
    Great effect, very dynamic !
    6R
     
  3. Gozdek

    Gozdek

    Joined:
    Jun 21, 2015
    Posts:
    356
    Nice
     
  4. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    842
    Does this work with 2D tool kit as well?? or just Unity's 2D tools?

    nm read your docs...

    Does Exploder 2D support 3rd party Unity plugins like 2D toolkit?

    A: No, it doesn’t. Exploder 2D is exclusively made only for Unity built-in Sprites. The reason is that the other plugins like 2D toolkit are using standard 3d mesh (plane). For this case you can use the original Exploder package as it works with 3d meshes.


    if I knew that I would of bought that a long time ago, I must of missed that... bummer.. I only like 2d tool kit, vs Unity's 2d stuff.
     
    Last edited: Nov 22, 2015
  5. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi, sorry to hear that, I am considering to include the 2D Toolkit as well, as it seems to be still very popular.
     
  6. Fronne

    Fronne

    Joined:
    Sep 25, 2014
    Posts:
    112
    Hi Reindeer,

    I have both Exploder an Exploder2D, the last one I purchased a few weeks back and I like it a lot. However, I miss one option for the Fragments, something like "Inherit Sprite Renderer Color"...

    I use a Base (White Colored) Sprite, in the Sprite Renderer Component (sometimes in Code) I will give them their Actual Color. Whenever I explode the Sprite, all Fragments are white. I know when I use a colored Image for the Sprite it will be solved but I don't want to modify 50+ Levels because it should be very simple to adjust it in your code...

    I found the code where I can modify the Fragment Color, perhaps you can tell me where to "extract" the Color from the Sprite Renderer Component and save it in a var so I can modify it myself, no problem...

    Code (CSharp):
    1.  
    2. var fragment = new GameObject("fragment_" + i);
    3. fragment.AddComponent<SpriteRenderer>();
    4. fragment.GetComponent<SpriteRenderer>().color = new Color (192, 192, 0, 255); // Added by me
    5. fragment.AddComponent<PolygonCollider2D>();
    6. fragment.AddComponent<Rigidbody2D>();
    7. fragment.AddComponent<Exploder2DOption>();
    8.  
    When you insert an option to Inherit the Sprite (Renderer) Color in a future release, it will be appreciated a lot!

    Thanks in advance,
    Franco Palmieri - Fronne
     
  7. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    I'll add it to next update, I think it's a good feature, thanks for the feedback!

    Best,
    RG
     
  8. Fronne

    Fronne

    Joined:
    Sep 25, 2014
    Posts:
    112
    Hi Reindeer,

    Thanks for this feature in the next Update()...

    Perhaps you can tell me a workaround to add it myself in release 1.0, our game will be published within a few weeks and it would be great if we can explode our sprites in the right color...

    If you tell me where I have to look inside your code (linenumber or something) I can give it a try myself...

    I will write a Review later today, Exploder 2D deserves it...
    EDIT: I just submitted the Review...

    Cheers,
    Franco Palmieri - Fronne
     
    Last edited: Dec 8, 2015
  9. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    I have good news for you, the new version 1.0.1 is already on AssetStore! I had a little more time to do the fix today and it was quite easy. Look for the option InheritSpriteRendererColor, it's turned on by default.

    Let me know if you have any problems.

    And thanks for the review, I really appreciate it!
     
    Fronne likes this.
  10. Fronne

    Fronne

    Joined:
    Sep 25, 2014
    Posts:
    112
    Good news INDEED, works PERFECT as aspected...
    Thanks a lot for breaking the speed of light! :)

    Cheers,
    Franco Palmieri - Fronne
     
  11. CrystalDynamo

    CrystalDynamo

    Joined:
    May 22, 2014
    Posts:
    120
    The following is my review and included code for those interested.

    First of all thanks for all that great code Reindeer games.

    My need was for something that could destroy structures and at times lots of objects. I wasn’t too worried with frame rate as this was rare.

    I wrestled a bit with handling lots of objects. Some objects would not get destroyed when they should if it came under heavy load.

    I really wanted this to work for me as I liked it so much I was just pushing it hard. So I wrote a little work around that used the example code as a base and I added a clean up function that would be invoked in the future and fire the destruction off again. This would retry twice and if that failed just destroy the object in question. It was an easy work around for me and I tested it with a multitude of objects and it works fine.


    Here is my modified code of the existing example code that I attached to an object. It is for destructions that ignore the sprites Tag.

    All I really did was add the gameObjectDeathCleanUp () function and use. Nothing slips by now when under heavy load in my application of it. I hope it may be of some use to someone else.



    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class EnemyExplode : MonoBehaviour {
    5.  
    6.     public bool dead = false;
    7.     float deathRetryCounter = 0;
    8.  
    9.     // Use this for initialization
    10.     void Start () {
    11.  
    12.     }
    13.  
    14.     // Update is called once per frame
    15.     void Update () {
    16.  
    17.     }
    18.      
    19.     void OnCollisionEnter2D(Collision2D coll) {
    20.  
    21.         // If I am not dead
    22.         if (!dead) {
    23.  
    24.             // If the hit was strong enough to destroy me
    25.             if (coll.relativeVelocity.magnitude > 1.50f) {
    26.  
    27.                 // Destroy the sprite
    28.                 Death ();
    29.  
    30.             }
    31.         }
    32.     }
    33.  
    34.     void Death()
    35.     {
    36.  
    37.         // Set the flag that I am now dead
    38.         dead = true;
    39.  
    40.         // Get handle to the exploder singleton
    41.         var exploder = Exploder2D.Utils.Exploder2DSingleton.Exploder2DInstance;
    42.  
    43.         // If all is well with the singleton          
    44.         if (exploder)
    45.         {
    46.  
    47.             // move exploder on the position of this object
    48.             exploder.gameObject.transform.position = Exploder2D.Exploder2DUtils.GetCentroid(gameObject);
    49.             exploder.DontUseTag = true;
    50.             exploder.Radius = 0.2f;
    51.             exploder.Explode();
    52.  
    53.             // Call the destruction fail safe if the object still exists
    54.             // after it should have been destroyed + 1 sec.  
    55.             Invoke ("gameObjectDeathCleanUp", exploder.DeactivateTimeout + 1.0f);
    56.         }
    57.     }
    58.  
    59.     void gameObjectDeathCleanUp () {
    60.  
    61.         // Used for gameobjects that are dead but never destroyed.
    62.         // If I get here I need to blow up again.
    63.  
    64.         // Keep a track of how many times I have retried.
    65.         deathRetryCounter = deathRetryCounter + 1;
    66.  
    67.         // If I am retrying more than 2 times then something is seriously
    68.         // wrong so destroy the object manually with no sprite
    69.         // destruction. This never happens it is just a fail safe.
    70.      
    71.        if (deathRetryCounter > 2) {
    72.          
    73.             Destroy(gameObject);      
    74.  
    75.         } else {
    76.  
    77.             // Retry sprite destruction
    78.             Death ();
    79.         }
    80.     }
    81. }



    I know my work around is at a high level but it puts the onus on the object in question I guess for its own destruction. Maybe something like it in the future could be built into the Explodable2D script that we attach to non tagged objects for destruction. I am by no means an expert in Exploder2D just guessing.

    All in all the hard work is done by the Exploder2D that was just my experience and I solved the issue with that work around I’d like to share in the review.

    Thanks for Exploder2D Reindeer Games it has saved me a lot of learning and coding.
     
  12. Robert_07

    Robert_07

    Joined:
    Mar 28, 2015
    Posts:
    12
    Hello. I just bought the Exploder2D asset.
    I´m using Unity 5.4.0 (win).
    I need to use it in a WebGL game.
    When I run it in the Unity editor gives me 12 deprecated warnings (I copy one below.)
    I suppose you are aware of this matter. Is there a fix for this error?
    If I fix it, will it work in WebGL? Does your other asset, Exploder runs in WebGL?
    I can´t use this asset if it does not run in WebGL.
    Thanks,

    Warning:

    Assets/Exploder2D/Exploder2D/Fragment2D.cs(125,17): warning CS0618: `UnityEngine.ParticleEmitter' is obsolete: `This component is part of the legacy particle system, which is deprecated and will be removed in a future release. Use the ParticleSystem component instead.'
     
  13. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547

    Hi there,

    yes, the new Particle system has been deprecated, I have already fixed it in Exploder, now I am working on Exploder 2D update.

    Those are only warnings anyway, you still should be able to build it in WebGL.

    I tested Exploder (3D) in WebGL and it is very slow, the performance is way too bad to be usable in production, Exploder 2D works in WebGL with reasonable settings, so you can use that one.

    Let me know if you have more problems.

    Best,
    RG
     
  14. Robert_07

    Robert_07

    Joined:
    Mar 28, 2015
    Posts:
    12
    Hi RG,
    When I try to build in WebGL the DemoClickExplode2D scene, it does not work at all.
    It gives me this error in the development console:
    UnityException: Tag: - Exploder2D is not defined.
    How can I fix it?
    Thanks.
     
  15. Robert_07

    Robert_07

    Joined:
    Mar 28, 2015
    Posts:
    12
    I figured out how to fix the Tag error...
     
  16. Fronne

    Fronne

    Joined:
    Sep 25, 2014
    Posts:
    112
    It's an error in Unity 5.4.3p1 now (in 5.4.3f1 only a warning), ParticleEmitter is gone forever in Unity 5.5 I guess...

    `UnityEngine.ParticleEmitter' is obsolete:
    `This component is part of the legacy particle system, which is deprecated and will be removed in a future release. Use the ParticleSystem component instead.'

    [CompilerError] `UnityEngine.ParticleEmitter' is obsolete:
    `This component is part of the legacy particle system, which is deprecated and will be removed in a future release. Use the ParticleSystem component instead.'
    0. Compiler Error at Assets/Exploder2D/Exploder2D/Fragment2D.cs:125 column 17


    private ParticleEmitter[] emmiters; //Jumps to this Error...

    Can you provide a quick fix please, I need it ASAP...
    A few words how to solve this would be great...

    Cheers,
    Franco Palmieri - Fronne
     
  17. Fronne

    Fronne

    Joined:
    Sep 25, 2014
    Posts:
    112
    Weird...
    I just tried again in Unity 5.4.3p1 and the error is gone, just a warning again...
    I'm going to try it in Unity 5.5.0f2 later tonight to see what happens...
     
  18. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi, I will make the fix later today. The particle emmiter was deprecated and Unity 5.5 does not support it anymore. Thanks for the feedback.
     
    Fronne likes this.
  19. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    I have just uploaded version 1.0.2 to Asset Store with all the fixes. It should be available in less than an hour.

    Cheers,
    RG
     
    Fronne likes this.
  20. Fronne

    Fronne

    Joined:
    Sep 25, 2014
    Posts:
    112
    THNX A LOT for breaking da Speed of Light...
    GREAT SUPPORT (AGAIN)!!!

    Cheers,
    Franco Palmieri - Fronne
     
  21. Fronne

    Fronne

    Joined:
    Sep 25, 2014
    Posts:
    112
    Version 1.0.2 works like a charm, the only problem I had was with the (renamed) Class Score, it was Score2D in the past and I had to change a few references and the class name into the old Score2D again to fix the errors I got...

    I have a plugin (Combu) already defining the same Class. Score is a very common name so it might be better to change it back to Score2D in a future Release. Just a minor issue...

    Thanks Again for the Great an Fast Support!!!
    Cheers,
    Franco Palmieri - Fronne
     
  22. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Okay,

    the name "Score" comes from the free Unity demo project, I will rename it.

    Thanks for the feedback.

    Cheers.
     
    Fronne likes this.
  23. a-tauzzi

    a-tauzzi

    Joined:
    Dec 20, 2015
    Posts:
    33
    I'm using this code snippet to destroy an object:

    Code (CSharp):
    1.    
    2. private void ExplodeObject(GameObject explodableSprite)
    3.     {
    4.         var exploder = Exploder2D.Utils.Exploder2DSingleton.Exploder2DInstance;
    5.  
    6.         exploder.transform.position = Exploder2D.Exploder2DUtils.GetCentroid(explodableSprite);
    7.         exploder.Radius = 1.2f;
    8.         exploder.Explode();
    9.     }
    10.  
    Sometimes, after the destruction, the original object is still there.
     
  24. pako

    pako

    Joined:
    Nov 21, 2012
    Posts:
    111
    The developer of this asset is irresponsible, and doesn't care about his customers!

    His other asset "Exploder" has bugs, but he doesn't fix them, and he doesn't respond to support questions or answer forum posts.

    He just deprecated "Exploder" a few days ago, and left many of his customers, especially the most recent ones completely unsupported, with incomplete documentation to refer to, and buggy software.

    I believe Unity should take some measures against developers like this.
     
  25. JesterGameCraft

    JesterGameCraft

    Joined:
    Feb 26, 2013
    Posts:
    452
    I have to agree with pako. reindeer-games you've lost a customer here, for whatever it counts.

    Edit: Exploder is back from being deprecated. Not sure what is going on...
     
    Last edited: Apr 18, 2018
    pako likes this.
  26. Cappinator

    Cappinator

    Joined:
    Apr 21, 2018
    Posts:
    1
    I want to run some code after the explosion is done. Is there a way to use a callback?

    Edit: And this is why you dive into the code before asking a question :)
    Found my answer:

    exploder.Explode((float timeMS, ExplosionState state) => {
    if (state == ExplosionState.ExplosionFinished)
    {
    ReleaseMe();
    GameManager.Instance.DoSomething();
    }
    });