[RELEASED] Exploder 2D: realtime sprite explosion system

Hello everyone,

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

2366909--160717--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:
Unity Asset Store - The Best Assets for Game Making

2366909--160717--logo.png

2 Likes

Fantastic system !
Great effect, very dynamic !
6R

Nice

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.

Hi, sorry to hear that, I am considering to include the 2D Toolkit as well, as it seems to be still very popular.

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…

var fragment = new GameObject("fragment_" + i);
fragment.AddComponent<SpriteRenderer>();
fragment.GetComponent<SpriteRenderer>().color = new Color (192, 192, 0, 255); // Added by me
fragment.AddComponent<PolygonCollider2D>();
fragment.AddComponent<Rigidbody2D>();
fragment.AddComponent<Exploder2DOption>();

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

Hi,

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

Best,
RG

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

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!

1 Like

Good news INDEED, works PERFECT as aspected…
Thanks a lot for breaking the speed of light! :slight_smile:

Cheers,
Franco Palmieri - Fronne

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.

using UnityEngine;
using System.Collections;

public class EnemyExplode : MonoBehaviour {

    public bool dead = false;
    float deathRetryCounter = 0;

    // Use this for initialization
    void Start () {
  
    }
  
    // Update is called once per frame
    void Update () {
  
    }
      
    void OnCollisionEnter2D(Collision2D coll) {

        // If I am not dead
        if (!dead) {

            // If the hit was strong enough to destroy me
            if (coll.relativeVelocity.magnitude > 1.50f) {

                // Destroy the sprite
                Death ();

            }
        }
    }

    void Death()
    {

        // Set the flag that I am now dead
        dead = true;

        // Get handle to the exploder singleton
        var exploder = Exploder2D.Utils.Exploder2DSingleton.Exploder2DInstance;

        // If all is well with the singleton          
        if (exploder)
        {

            // move exploder on the position of this object
            exploder.gameObject.transform.position = Exploder2D.Exploder2DUtils.GetCentroid(gameObject);
            exploder.DontUseTag = true;
            exploder.Radius = 0.2f;
            exploder.Explode();

            // Call the destruction fail safe if the object still exists
            // after it should have been destroyed + 1 sec.  
            Invoke ("gameObjectDeathCleanUp", exploder.DeactivateTimeout + 1.0f);
        }
    }

    void gameObjectDeathCleanUp () {
  
        // Used for gameobjects that are dead but never destroyed.
        // If I get here I need to blow up again.

        // Keep a track of how many times I have retried.
        deathRetryCounter = deathRetryCounter + 1;

        // If I am retrying more than 2 times then something is seriously
        // wrong so destroy the object manually with no sprite
        // destruction. This never happens it is just a fail safe.
      
       if (deathRetryCounter > 2) {
          
            Destroy(gameObject);      

        } else {

            // Retry sprite destruction
            Death ();
        }
    }
}

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.

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.’

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

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.

I figured out how to fix the Tag error…

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

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…

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.

1 Like

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

1 Like

THNX A LOT for breaking da Speed of Light…
GREAT SUPPORT (AGAIN)!!!

Cheers,
Franco Palmieri - Fronne