Search Unity

Exploder [RELEASED]

Discussion in 'Assets and Asset Store' started by reindeer-games, Jul 12, 2013.

  1. zngb

    zngb

    Joined:
    Aug 5, 2015
    Posts:
    20
    Was this solved? It happens to me now that I loaded my scene the second time since adding Exploder, which worked fine the first time.
    Ignore Tag is checked and I added an "Explodable" script on my GameObject. When it starts exploding there's "Tag: E is not defined." all over.
     
  2. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    315
    There is a design weakness with
    private readonly Dictionary<GameObject, CrackedObject> crackedObjects; in CrackManager.cs

    I'm using PuppetMaster which clones pickup objects and reconstructs how they are setup when they are picked up, and clones them again to restore the original setup when they are put down. The result is that I crack a shield before it is picked up, attempt to destroy it while it is held, and the call fails.

    Basically this design doesn't work with cloned objects, which is sometimes correct and sometimes not.

    If you for example added a component to objects that were cracked, instead of having this dictionary, it would solve the problem.
     

    Attached Files:

  3. kwt127

    kwt127

    Joined:
    Mar 8, 2015
    Posts:
    5
    Hi. I'm not good at English, sorry if it's weird.

    [Execution environment]
    Unity 5.63f1
    Exploder 1.7.4

    If you move the cracked object to another scene and blow up it will not show debris.
    Although fragments are generated normally, it seems that the reference to the mesh of the fragments has broken.
    This code worked fine at Unity 5.25f1.
     
  4. Braddas

    Braddas

    Joined:
    Jun 9, 2013
    Posts:
    25
    Apologies if this has been asked before, it is possible to explode a cracked object more than once? I'm pooling objects and cracking them before the game begins to try get things running as smoothly as possible. Trouble is when I respawn a pooled object that has previously exploded, I can't figure out how to re-explode it without cracking it again (which unfortuantely removes the benefit of pre-cracking in my situation).
     
  5. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Sooo... there is a longstanding bug happening with cracking objects and then calling ExplodeCracked(gameobject) when an object is exploding itself. It seems to duplicate the mesh twice so that there are two copies of it being exploded, so an object with have multiple fragments of the same parts, as in two heads and what not...

    To recreate this bug... I took the barrel object from your SceneExplodeSelf demo scene, set target fragments to two for easy visualization and called CrackObject and then ExplodeCracked (Gameobject). You'll have two full copies of the object mesh as fragments. I'll email you a modified demo scene SceneExplodeSelf. Also I used Playmaker in the scene to call the methods... and a sidenote... I noticed that the audio is called when you crack the object as opposed to ExplodeCracked...
     
    Last edited: Sep 30, 2017
  6. AnomalusUndrdog

    AnomalusUndrdog

    Joined:
    Jul 3, 2009
    Posts:
    1,553
    Anyone else unable to access the documentation online? I'm surprised to find out the Documentation.pdf inside the asset package just tells you to go to a Google docs link. Does anyone have an offline version of the docs?

     
  7. rame16

    rame16

    Joined:
    Nov 21, 2012
    Posts:
    29
    Is it maintained? ...Thanks
     
  8. zngb

    zngb

    Joined:
    Aug 5, 2015
    Posts:
    20
  9. MicDE

    MicDE

    Joined:
    Dec 15, 2015
    Posts:
    16
    Hi
    upgrade to 1.7.5 creates a compile error. TaskType "PartialSeparator" was removed so the package does not compile any more. Was it removed by accident?
    Best
    Mic
     
  10. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Also is anything pre 2017.1.2 still supported? Thx...
     
  11. wholtaeter

    wholtaeter

    Joined:
    Mar 30, 2016
    Posts:
    15
    Hi,
    I was trying to let this object explode, but I wont. - Any suggestions how could I explode it?

    Other Objects are exploding.
     

    Attached Files:

  12. wholtaeter

    wholtaeter

    Joined:
    Mar 30, 2016
    Posts:
    15
  13. LunaTrap

    LunaTrap

    Joined:
    Apr 10, 2015
    Posts:
    120
    I'm looking into buying this, but I need to know 1 thing

    Is there a way for me to custom the pieces? for example, I want my pieces to carry sounds when they bounce, also a script and to have a particle system to spread blood.
     
  14. OlliIllustrator

    OlliIllustrator

    Joined:
    Nov 1, 2013
    Posts:
    71
    Damn, this was a fine asset and now it is a mess--
    I have not used it in a while, now want to use it in 2 Unity 5.6x projects...
    It is not clear if the 2017 version will work in 5.6, and the author has deleted the asset store packages for the other versions (I hate that, why not simply leave them there? Unity make that possible but unfortunately offers no real version history). And the docs have vaporized because they were online only--.
    Author, please fix this, Thx.
     
  15. OlliIllustrator

    OlliIllustrator

    Joined:
    Nov 1, 2013
    Posts:
    71
    I just tested the Asset and it exploded just fine.
    Since the asset is a single mesh I would not expect any problems anyway.
    I am using an older version of exploder, though (that I luckily found on my old computer).

     
  16. trojanfoe_

    trojanfoe_

    Joined:
    May 20, 2014
    Posts:
    53
    Has the developer walked away from this asset? He hasn't replied to any questions in this thread and there have been compilation warnings for a while now:

    [CS0618] `UnityEngine.GUITexture' is obsolete:
    `This component is part of the legacy UI system and will be removed in a future release.'

    and about 16 others.
     
  17. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    Many devs are busy with their day jobs and if the forum stops notifying them of new posts to the thread they may forget to visit. So try contacting the dev via support email if there is a support issue.
     
  18. JesterGameCraft

    JesterGameCraft

    Joined:
    Feb 26, 2013
    Posts:
    452
    I've contacted the developer via email, he responded. I suggest you
    I contacted developer via email and he responded. I suggest you try email. It's too bad he doesn't visit the forum as much but supposedly the notifications from Unity Forum system are spotty, I can't comment on that.
     
  19. RonTang

    RonTang

    Joined:
    May 20, 2017
    Posts:
    8
    Hi,there
    I want to use this function as follow : public long ExplodePartial(GameObject gameObject, Vector3 shotDir, Vector3 hitPosition, float bulletSize)
    I don't want to this object explode entirely.But this function seems useless at current,This fuction doesn't use shotDir,hitposition,bulletsize.....,Please help me.
    Thanks.
     
    Last edited: Dec 21, 2017
  20. fazhom

    fazhom

    Joined:
    Jan 18, 2013
    Posts:
    10
    Hello

    I can't find the "open mesh cutting" in the options...
    Without it, the meshes I bought in a pack won't explode. It works fine on closed meshes.
    I'm usins version 1.7.5 of exploder.
     

    Attached Files:

  21. pako

    pako

    Joined:
    Nov 21, 2012
    Posts:
    111
    I can't find FrameBudget in the Inspector, I can't get Cracking to work, and I've tried contacting the developer in the past 3 days, both through the Contact Form in his website and the e-mail listed in the documentation. Additionally, he hasn't posted in this forum since May 2017, and he is nowhere to be found!

    This asset is NOT supported any more!
     
  22. ParadoxSolutions

    ParadoxSolutions

    Joined:
    Jul 27, 2015
    Posts:
    325
    Considering the author has multiple assets and has supported this one for 5 years I find it unlikely that he just dropped out of contact without reason, could be personal issues, a top secret project soon to be released or maybe he got hit by a bus, 3 days is a little to early to judge. I'm looking into purchasing this asset myself and can probably fix any errors if there are any. In the mean time we can try to get his attention with @reindeer-games
     
  23. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,490
    Hi, I agree with firefightgi..I'd give the developer more time to respond. Also if you wanted to you can detail the "issues" here, you never know someone might be able to help you in the meantime.
     
  24. ParadoxSolutions

    ParadoxSolutions

    Joined:
    Jul 27, 2015
    Posts:
    325
    I have just purchased the asset and the demo scene works just fine and there are no errors in console, it is really hard to tell how to set up the system based on the demo alone, based on the docs I think some things are assumed that you need to know how to code to do. I'm still playing with it so I'll see if I run into the issues pako has.
     
  25. tetetete

    tetetete

    Joined:
    Nov 12, 2016
    Posts:
    22
    And deprecated :/
     
  26. ParadoxSolutions

    ParadoxSolutions

    Joined:
    Jul 27, 2015
    Posts:
    325
    Yikes! You're right, I probably shouldn't have bought it right on its way out. I would still like to know the authors reasoning.
     
    Flurgle likes this.
  27. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    According to the forums, he was last visiting the forums just yesterday. So he's around, even if he's invisible and unresponsive. ;)
     
    ParadoxSolutions likes this.
  28. pako

    pako

    Joined:
    Nov 21, 2012
    Posts:
    111
    I've purchased a ton of assets from the Asset Store, and typically, I get a response for support questions within minutes or within hours. The least that the author should do in the cases you mention, is hit "Reply To" in the e-mail client, and type a few words e.g. "I'm out of town, will respond next week".

    Not replying at all is unprofessional and unacceptable by my standards, and according to my experience reflects the developers of about 5% of the Assets in the Asset Store, who will either never respond, or will respond after 1-2 months, when you don't need their response any more. And when I say 5%, I mean that I have purchased over 100 assets from the Assets store in the past 5 years, and there about 4-5 such developers.
     
  29. pako

    pako

    Joined:
    Nov 21, 2012
    Posts:
    111
    Ten days later, still no response...
     
  30. pako

    pako

    Joined:
    Nov 21, 2012
    Posts:
    111
    Just noticed, I'm not always getting e-mail notifications of forum posts.

    However his other assets are still available... I think I should warn the community about this guy, both in the Asset Store, and his other assets forums. Totally unprofessional and unacceptable!
     
  31. pako

    pako

    Joined:
    Nov 21, 2012
    Posts:
    111
    Hi,

    The basic setup worked fine for me after I read the documentation. So, if you're having any problems with the basic setup, I'll be glad to help you out.
     
  32. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,490
    Not sure why had to let me know that!
    Some advice for you is, that is if you want it:
    Maybe you can try to help yourself a bit here too:
    Have you like sent him another email to follow up?
    Have you tried to debug the code some more yourself?
    Have you looked at sharing the issue(s) details here, then many other developers can chip in.. let us know: Where in the docs does it about framebudget or cracking is supported, have you checked all of this, which version was that documented in? Have you got a old (or new 2018 beta?) Unity version, do share with us ! Do you see any compiler errors, which platform are you targeting Windows Android PS4??

    Just sitting there waiting + twiddling your thumps won't help you :)

    P.S. I use exploder without any errors, for a while now, I am a happy customer. I could be wrong of course but I suspect there is an issue in your environment, unless you can prove otherwise. Otherwise many other people would be complaining..
     
  33. pako

    pako

    Joined:
    Nov 21, 2012
    Posts:
    111
    I let you know that, because in your post dated 8 February you quoted my post and said: "...I'd give the developer more time to respond...".

    I know that in the meantime, the developer deprecated his asset, even though it still has bugs, and he had not replied to all his support requests. Also, I wasn't aware of the deprecation when I posted my reply to you. In any case, a true professional should have fixed the bugs, and respond to all his support requests, even if he intended to deprecate his asset.

    Yes, I sent him a couple of follow ups. I know how to work.

    You mean debug his code? Well, I've stepped though his code in the debugger (VS) very carefully before posting here or even contacting him. That's how I work. But one of the advantages of purchasing assets from the Asset Store, is that it is implied that the developers will maintain and if necessary fix their code.

    Nevertheless, as things are now, I will use the basic setup for the moment, with which I have no problem, since I've read carefully his documentation, and tried all his demos. When I get the time, I will fix his code.

    If others in this forum can help me out as you suggest I'd be grateful:

    In page 15 of the documentation, there's a screenshot of an Inspector field named "Frame Budget [ms]". Also in page 16 there is a description of what that field does. In the latest version of Exploder that field is missing from the Inspector.

    I found the relative field in ExploderObject.cs line 75. Since it was set by default to 15, which is OK for me I didn't look in the editor scripts.

    EDIT: However, as I'm writing this, I did look in the editor scripts, and found (EditorExploderObject.cs line 146) that this field appears in the Inspector, only if Multi-threading is disabled. I guess that in this particular case, I'm guilty for trusting the documentation, since it doesn't mention anywhere anything about the dependency of this Inspector field to the Multi-threading setting.

    Object Cracking, which I need to use in conjunction with an Object Pool, is described in the documentation page 9, and the example in DemoClickExplode.cs.

    I followed both the documentation and the example, and I get the error: "GameObject GameObjectName not cracked, Call CrackObject first!", even though I do call CrackObject first.

    So, I stepped through the code and found that in CrackManager.cs the crackedObjects Dictionary is not null but is Empty. So, I get the above error, because in CrackManager.cs line 34 the if condition is false. I also found that this happens because the CrackManager.Create() method doesn't ever get called.

    I couldn't figure out why this happens, since I was doing everything right per the documentation, and the example, which BTW worked fine for me. So, I started searching online for solutions. Maybe someone else had a similar problem...

    I found some posts in this forum, which got me worried:
    1. Post by @Braddas (Sep 13 2017) who uses pooling unsuccessfully. He didn't get the error I was getting, but I wanted to use Cracking with pooling. This post was never answered, so there was one reason more than my error to contact the developer.
    2. Post by @christougher (Sep 28 2017) which wasn't directly related to my error but I was concerned about "the mesh getting duplicated twice so that there are two copies of it being exploded". Again, this post was never answered, so one more reason to contact the developer.

    At that point, I gave up, especially since I noticed many more unanswered posts in this forum reporting problems, and decided to contact the developer, and the rest you know.

    Any ideas?

    P.S. This is not really important, but I don't understand what gave you the false impression that "I'm just sitting twiddling my thumps", whereas I've spent many-many hours trying to solve these problems myself, and many hours writing to the developer.
     
  34. imgumby

    imgumby

    Joined:
    Nov 26, 2015
    Posts:
    122
    Deprecated ? Wonder how long the rest of his assets will be updated ...:cool:. Pretty much through buying script based assets that never get entirely bug free only to become abandonware after the developer pays off his canoe with my money.Kinda like taking possesion of a 1/2 painted car on the promise that the paint will be done someday...maybe the steering wheel nut will come in by then as well...lol..o_O

    ;)
     
    pako likes this.
  35. StormchaserZA

    StormchaserZA

    Joined:
    Nov 13, 2016
    Posts:
    30
    Is reindeer-games still around?
     
  36. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    According to the forum, yes. It says he was last online two days ago.
     
    StormchaserZA likes this.
  37. zngb

    zngb

    Joined:
    Aug 5, 2015
    Posts:
    20
    This doesn't seem to be an abandoned asset. From the asset page: "1.7.6 (current) released Apr 5, 2018" - https://assetstore.unity.com/packages/tools/particles-effects/exploder-9771

    Maybe reindeer just got tired participating in this thread :(?

    Anyway, I made a little hack I wanted to share:

    I use ExplodeRadius in my code and I had to run code on every GameObject that got "Exploded". Failing to find a way to do it (correct me if I missed something) I thought that maybe if I add a C# event on the Explodable script of the asset, I could subscribe to it from another script in my GameObject.

    And the hack is, that inside Exploder asset's Core/Tasks/Preprocess.cs file there's a loop that iterates on all objects which are IsInRadius(o). This is where I checked if this 'o' (the object which Exploder is trying to explode) has an instance of the Explodable script and if it does, call a public function that triggers the event in that script.

    It worked.

    Why is this a hack? Because this code shouldn't really be inside Preprocess.cs IMHO. But it worked for my mini-game and I want to be done with it already.
     
  38. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Exploder Documentation

    Version 1.3.7

    Table of contents

    1 Introduction

    2 How does it work?

    3 Quick start

    4 How to use it in my FPS game?

    5 Exploding 2D sprite (Plane mesh)

    6 Cracking object (pre-calculated explosion)

    7 Using multiple Exploders at the same time

    8 Custom texture for inner side of exploded fragments

    9 Deactivation options

    10 ExploderObject settings

    11 2D Physics (Unity4.3+)

    12 UFPS integration (version 1.3.2)

    13 Playmaker support

    14 FAQ

    15 Support

    1 Introduction

    Exploder is a Unity3d plugin that allows you to explode any GameObject that contains a mesh in real-time.


    The destruction calculation is processed in real time. There are no pre-calculations or predefined GameObjects. Just put your beloved GameObject in the scene, Tag it with “Exploder” and watch the explosion!



    Destroying vases from the Demo

    2 How does it work?

    The library contains a powerful mesh cutter that finds a mesh in your GameObject. After that it cuts the mesh recursively to small pieces, assigns a rigid body and velocity to each of them and makes an explosion.

    For best possible performance the fragments are pre-allocated in a pool to minimize creating and instantiating GameObjects.

    Cutting algorithm is very fast however you can specify time budget which is the maximum time to spend on calculation in a single frame. This allows you to create a powerful explosion in few frames with low or no FPS drop.

    3 Quick start

    The usage is very simple:

    Create empty GameObject and rename it to “Exploder”
    Assign ExploderObject component to “Exploder”
    Adjust parameters in the inspector (or from the code)

    radius
    target fragments


    Tag all objects you want to explode with the name “Exploder” (if you can’t see “Exploder” in tag list, you have to create one)
    Move “Exploder” GameObject to desired position so it covers your objects with the red sphere radius.
    Create a demo script with public variable to access “Exploder” and call Explode(...)
    Watch the explosion!

    Tip: you can use Exploder prefab located in:

    Exploder/Prefabs/Exploder.prefab

    For the script reference please see the attached demo examples in DemoClickExplode.cs.

    This will guide you how to create a simple scene (also included in the package). Please watch the Youtube video on this address:



    4 How to use it in my FPS game?

    Tip: from version 1.3.2 you can integrate Exploder with UFPS camera project, see more information in this chapter.

    This package also contains a first person shooter demo to demonstrate how the Exploder can be used with various weapons.



    Shotgun example from the Demo

    The basic idea:

    Create empty GameObject with ExploderObject component.
    (Setup your weapon and camera) and shoot with your mouse.
    At the same moment run a raycast in direction from the camera.
    Get an intersecting GameObject (ex. Vase).
    Move ExploderObject to the position of the intersecting GameObject (ex. now the ExploderObject has the same position as the Vase).
    Call Explode()
    Watch explosion!



    RPG example from the Demo

    The setup for the RPG or Grenade is very similar. Just shoot a rocket (or throw a grenade) and when it hits the object (or after a timeout) move your ExploderObject to the same position and call Explode().

    You don’t need to maintain several ExploderObject components. Just only one and always move it to desired position.

    All source code is included so you can see how the demo is constructed.

    5 Exploding 2D sprite (Plane mesh)

    Tested with 2D Toolkit.

    (For the 2D physics support, see the 2D Physics chapter)

    Exploder also works very well with 2D sprites or plane meshes. The only thing you have to do is to mark the object in ExploderOption settings.

    ExploderOption is another script object you can find in the asset folder together with ExploderObject. You have to assign this script to your game object (sprite) you want to explode. There are several options in the script:



    As you can see there is a checkbox “Plane 2D”. By selecting it you specify that this object (owner game object) is a 2d plane or a 2d sprite. Later when you run the explosion Exploder will look for the ExploderOption and if it is marked as 2d plane it will change the explosion calculation to work with 2d meshes.

    In short:

    Find ExploderOption script and assign it to your 2d game object
    Check the “Plane 2D” option
    Run the explosion!

    6 Cracking object (pre-calculated explosion)

    Cracking the game object is another feature that allows you to run explosion calculation = prepare the object for explosion and later immediately execute the explosion.

    The advantage of using the crack is PERFORMANCE. You can simply run the expensive calculation a long time before the explosion and then execute the explosion instantly. This can be useful especially on mobile devices, where the performance is lower than on desktop machine.

    Usage:

    Usage is similar to calling Explode(), you only need to call Crack(…) for cracking the object and later call ExplodeCracked(…). For script reference please see the attached example:

    DemoClickExplode.cs

    You only need to uncomment the macro ENABLE_CRACK_AND_EXPLODE on the third line to see cracking in action.

    The disadvantage of using crack is that you cannot use more than one cracked object at the same time. You can crack only one object at the time, explode it and then crack a new one.

    7 Using multiple Exploders at the same time

    Using multiple Exploder objects at the same time to achieve simultaneous explosions is NOT SUPPORTED and NOT RECOMMENDED.

    The reason why is very simple. Exploder calculation can be very CPU expensive, during calculation it takes as much time as specified in FrameBudget parameter. Imagine this scenario with two Exploders:

    Exploder_1 with FrameBudget = 15 [ms]
    Exploder_2 with FrameBudget = 15 [ms]
    Game is running in average 30 FPS, Exploder_1 runs explosion and takes approximately half of the framerate, the game experience is still acceptable. Exploder_2 runs another explosion at the same time and takes approximately another half of the framerate. The game FPS reaches 0 and player is experiencing lag that can take several frames.

    If you really need to run as much explosions as possible in small amount of time, you can always increase the value of FrameBudget. For example if you set FrameBudget = 100, you can easily run more than one explosion in one or two frames, however it can heavily impact your framerate.

    8 Custom texture for inner side of exploded fragments

    Specifying custom texture to the inner side of the fragment can be important for your game. For example exploding alien with green blood should show green texture inside the fragments. Exploder allows you to do that in slightly different way. You cannot use completely new texture for performance reasons because it would require creating lots of new submeshes on fragments. However you can specify UV portion of the original texture inside ExploderOption script:



    Cross Section UV is the place where you can specify the UV mapping for the inner side of fragments.

    X is a starting U coordinate (between 0..1)
    Y is a V coordinate (between 0..1)
    Z is a ending U coordinate (between 0..1)
    W is a ending V coordinate (between 0..1)

    Example with green blood alien:

    This texture is an example how the character texture can look like. As you can see the UV coordinates are in range between 0 and 1. The green rectangle represents the alien blood.



    To use the green texture you need to specify the coordinates in ExploderOptions like this:



    9 Deactivation options



    Deactivation options allows you to specify when the fragment can be deactivated.

    Never means fragment will be active all the time
    OutsideOfCamera means fragment will be deactivated once the main camera doesn’t see it
    Timeout - means fragment will be deactivated after specified time after explosion

    In case of Timeout deactivation, you can also choose whether you want to fade-out the fragments:

    None - no fade-out option
    FadeOut Alpha - fragments will smoothly change its material alpha to zero and they will become fully transparent
    NOTE: this option will work only with transparent materials.
    ScaleDown - fragments will be smoothly scaled down to (0, 0, 0)

    10 ExploderObject settings





    Main Settings


    Ignore Tag


    Flag for not tagging Explodable objects. If you set this to TRUE you will have to assign "Explodable" script object to your GameObject instead of Tagging it. This is very useful if you already have tagged GameObject and you don't want to re-tag it to "Exploder".

    Radius


    Radius of explosion is a radius range in which the Exploder will be looking for destroyable objects. Notice the Red wire-frame gizmo in scene view.

    Target Fragments

    Number of fragments that will be created by cutting the exploding objects. More fragments means more calculation and more PhysX overhead and also better looking explosion.

    Frame Budget

    Time budget in [ms] for processing explosion calculation in one frame. If the calculation takes more time it is stopped and resumed in next frame. Recommended settings: 15 - 30 (30 frames-per-second takes approximately 33ms in one frame). However this settings depends on your game and average frames-per-second.

    Force Vector (and Use Force Vector)

    Note: this option is valid only if UseForceVector is true. ForceVector represents a 3d Vector direction in which the explosion fragments will be moving. For example with Vector(0, 0, 1) exploding fragments will fly in “UP” direction. In the Demo Shotgun weapon is using ForceVector in direction of the camera, so the fragments are always moving from the player.

    Mesh Colliders

    Using mesh colliders for fragments. Use this option wisely because mesh colliders are very slow and you should avoid them in most cases. Mesh colliders can be very useful if you want to run explosion with small or zero force.

    Force

    Force is how much the physical force is added to exploding fragments. More force means higher velocity.

    Explode Self

    Flag for destroying mesh in owner GameObject if there is any mesh component in it.

    Disable radius

    This option is valid only if ExplodeSelf is set to true. Disable radius scan for object, only the parent object will explode and nothing else.

    Hide Self

    Flag for hiding owner game object after explosion. This can be useful if you want to only hide and not to destroy owner object.

    Destroy Original Object

    Flag for destroying original game object after explosion. For example when you destroy a “chair” model, it will cut the chair to small pieces and create new fragment game objects. If this flag is true it will call Object.Destroy(chair) and destroy the original chair GameObject from the game. Otherwise the original object (chair) will be only deactivated.

    Split mesh islands

    Option for separating not-connecting parts of the same mesh. If this option is enabled all exploding fragments are searched for not connecting parts of the same mesh and these parts are separated into new fragments.

    Uniform distribution

    By enabling this Exploder will create number of fragments per object equally regardless of object distance from the center. By default objects closer to the center (exploder center) will be shattered into more fragments than objects far from the center. Uniform distribution will guarantee that all objects will be shattered into same number of fragments.

    Open Mesh Cutting

    This option will allow you to use exploder with non-closed meshes, for example airplane with windows (mesh with holes). However it will not always triangulate the fragments properly. Use this only if your object has holes inside and/or it doesn’t want to explode.

    Fragment options

    Explode Fragments

    Flag for destroying already destroyed fragments. If this is true you can destroy the object and then all its fragment pieces. You can keep destroying fragments until they are small enough.

    Fragment Pool Size

    Maximum number of all available fragments. This number should be higher than Target Fragments.

    Max Velocity

    Maximum velocity for fragments, higher velocity will be clamped.

    Max Angular Velocity

    Maximum angular velocity for fragments, higher velocity will be clamped.

    Random Angular Vector

    This will randomize fragment rotation after explosion. If this item is false you will have specify axis of rotation manually.

    Angular Velocity

    Angular velocity for fragments, if “Inherit parent physics” is enabled, final angular velocity will calculated as a sum of parent and this value.

    Disable colliders

    Disable colliders from all fragments, use this if you don’t want the fragments collide.

    Inherit parent physics

    By enabling this fragment will use same physics properties as its parent rigid body. It will inherit Mass, Velocity, Angular Velocity and Use Gravity. If there is no valid parent rigid body default settings will be used instead.

    Mass

    Mass of the fragment. if the parent object object has rigidbody and Inherit Parent Physics is true the mass property for fragments will be calculated based on this equation (fragmentMass = parentMass / TargetFragments)

    Layer

    Name of layer for fragments. Use this if you want to change default layer for fragments.

    Freeze position

    Freeze position of fragment in specified axis.

    Freeze rotation

    Freeze rotation of fragment in specified axis.

    Material

    Optional material for fragments, if not selected default material (first) from the original object is used

    SFX options

    Explosion sound

    Optional AudioClip that will be played on the beginning of explosion.

    Fragment hit sound

    Optional AudioClip that will be played when one of the fragment piece hit another object (collider).

    Hit sound timeout

    This option is valid only if Fragment hit sound AudioClip is set. Timeout between AudioClips, this is useful to prevent over-halting audio system when the explosion has lots of fragments.

    Fragment particles

    GameObject with particle emitters, that will be run when the explosion starts. Particles will be emitted from every fragment.

    Maximum emitters

    This option is valid only if Fragment particles is set. Maximum number of particle emitters, use low number if your game is experiencing lag.

    11 2D Physics (Unity4.3+)

    Tested with 2D Toolkit.

    Exploder support 2D physics as well. You can enable this feature by setting Use2Dcollision (Use 2D) to True. All explosion fragments will have 2D colliders (PolygonCollider2D).

    It is important that you will not use this settings with exploding 3D objects (it might work but it might lead to unexpected behavior).





    IMPORTANT NOTE:

    Exploder DOES NOT work with Unity4.3+ built-in sprites, because there is no way to access sprite mesh data required by Exploder.

    12 UFPS integration (version 1.3.7)

    Exploder has been successfully tested with Ultimate FPS camera 1.4.6, all you need to do is to copy/paste few script methods as described below.



    Add Exploder prefab to the scene (Exploder/Prefabs/Exploder.prefab). It is important to use this prefab because it also contains ExploderSingleton script for easy access of Exploder object.
    Open file vp_HitscanBullet.cs in UFPS folder.
    Add these two methods to the vp_HitscanBullet class:

    Code (CSharp):
    1. private void ApplyExploder(GameObject target)
    2.  
    3. {
    4.  
    5.     var exploder = Exploder.Utils.ExploderSingleton.ExploderInstance;
    6.  
    7.     if (exploder)
    8.  
    9.     {
    10.  
    11.         // check if the target is explodable object
    12.  
    13.         if (Exploder.ExploderUtils.IsExplodable(target))
    14.  
    15.         {
    16.  
    17.             // activate exploder
    18.  
    19.             Exploder.ExploderUtils.SetActive(exploder.gameObject, true);
    20.  
    21.             // move exploder object to the same position
    22.  
    23.             exploder.transform.position = Exploder.ExploderUtils.GetCentroid(target);
    24.  
    25.             // decrease the radius so the exploder is not interfering with other objects
    26.  
    27.             exploder.Radius = 1.0f;
    28.  
    29.             // DONE!
    30.  
    31.             exploder.Explode(OnExplosion);
    32.  
    33.         }
    34.  
    35.     }
    36.  
    37. }
    38.  
    39. private void OnExplosion(float time, Exploder.ExploderObject.ExplosionState state)
    40.  
    41. {
    42.  
    43.     if (state == Exploder.ExploderObject.ExplosionState.ExplosionFinished)
    44.  
    45.     {
    46.  
    47.         //Utils.Log("Exploded");
    48.  
    49.     }
    50.  
    51. }
    Locate method void DoHit() in the same class and find this code, it should be around line 158:

    hit.collider.SendMessageUpwards(DamageMethodName,Damage,SendMessageOptions.DontRequireReceiver);


    After this line add this command:

    ApplyExploder(hit.collider.gameObject);


    Done! You can now fine tune Exploder settings and see explosions in the game.

    Tip: if you have a diff tool, you can use a patch located in:

    Exploder/UFPS/patchUFPS_1.4.6.patch

    13 Playmaker support


    There are 3 Exploder custom actions ready to work with Playmaker:

    Crack
    Explode
    ExplodeCracked

    To enable these actions you have to open the action scripts located in

    Assets/Exploder/Playmaker/*

    …and uncomment the second line (//#define PLAYMAKER):

    from this:

    // uncomment next line to work with Playmaker

    //#define PLAYMAKER

    #if PLAYMAKER

    to this:

    // uncomment next line to work with Playmaker

    #define PLAYMAKER

    #if PLAYMAKER

    14 FAQ

    Q: I cannot explode my objects. Sometimes it creates only one big fragment.

    A: Make sure your objects are in exploder radius, properly tagged and the TargetFragments value is high enough. If it still does not work you can try to enable “Open mesh cutting” which is an option for exploding non-closed meshes. This option makes Exploder more tolerant to complex meshes with holes. If it still does not work, please contact me by e-mail with screenshot of your object hierarchy and your model in scene.

    Q: Explosion seems to be huge even if I set small Force value.

    A: It is because all fragments have by default box colliders and they are tight together overlapping each other, which might cause high explosion regardless of Force value. You can easily fix it by enabling Mesh colliders and/or limiting velocity with MaxVelocity parameter.

    Q: FadeOut Alpha does not seem to work. Fragments disappear in one frame (blink).

    A: FadeOut Alpha works only with transparent materials that allow to change alpha value.

    Q: Can I specify custom texture for fragments?

    A: You can specify UV portion from parent texture, see more details in this chapter.

    Q: Does Exploder support reverse explosion?

    A: Unfortunately not, Exploder can only explode objects in usual way.

    Q: Can Exploder destroy Unity sprite?

    A: Unity built-in sprites are not supported by Exploder because there is no way to access mesh data, this feature will be hopefully available in future version of Unity.

    Q: I don’t want to change the tag to “Exploder”, it already has one.

    A: You don’t have to, just make sure to enable “Ignore Tag” and add “Explodable” component to your game object.

    Q: Can Exploder destroy only a portion of the object, like a head or arm of a character?

    A: Unfortunately it can’t, Exploder works only with a whole mesh, in case of a character it will explode head, arm, body, legs and everything else at once.

    Q: Does Exploder support submeshes?

    A: It does, but in limited way. It can explode mesh with submeshes but resulting fragments will have only one mesh. It means that all fragments will have only one material.

    Q: How to access fragment pool and get active fragments?

    A: Please refer to file HowToGetActiveFragments.cs.

    Q: Can I use Exploder to create fragment prefabs?

    A: No, Exploder is only for real-time use. However you can use Crack() feature to pre-calculate explosion and execute it later.

    Q: Any tips for increasing performance?

    A: First of all TargetFragments, try to keep it low, less fragments mean less overhead and less calculations. Also make sure that FrameBudget is lower than half of your expected frame rate, for example game with 30 FPS should have FrameBudget 15 and less, otherwise you can notice lagging. Try to avoid Mesh colliders, they can be very expensive. Also don’t use SplitMeshIslands so much, it can save you few more frames. Don’t forget that performance is always about tradeoff, good luck with your game!

    15 Support

    If you have any questions or need a help with setting up the Exploder game object you can write to unity forum:

    http://forum.unity3d.com/threads/190198-Exploder-RELEASED

    or you can send me an e-mail to:

    gamesreindeer@gmail.com
     
  39. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
  40. kulesz

    kulesz

    Joined:
    Jul 1, 2012
    Posts:
    140
    Is there a way for a fragments (generated using Crack) to have their position inside mesh center, not in the original objects position?
    Right now I have cracked object with most of fragments having offset from the center.
     
  41. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Dunno.
    I would probably just hack them to be 0000.1% of their size - or hidden and switched in - or something.
     
  42. Volkerku

    Volkerku

    Joined:
    Nov 23, 2016
    Posts:
    114
    Problem with UV texture
    When I use teh Eploderscript on a 3D OBJ model, which includes a unlit material with a UV texture, most fragments have incorrect textures applied. A few though seem correct (see screengrab, before, after). Any idea how to fix?
     

    Attached Files:

  43. Volkerku

    Volkerku

    Joined:
    Nov 23, 2016
    Posts:
    114
    I figured it out (message above Problem with UV texture).
    But how can I explode in slow motion? I wouldlike the explosion to take ~10 seconds. The fragments sailing through the air very slowly.
     
  44. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    But have the real world go at normal speed? you don't say.
    If not just slow down physics or the timestep or something

     
  45. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    If you look at the foliage you'll notice everything is slowing down, not just the explosion. But this package uses physics forces, so your looking at manipulating physics and slowing down the particle systems, nothing this package will help with.. Maybe something like Chronos is what your after?

    https://assetstore.unity.com/packages/tools/particles-effects/chronos-31225
     
  46. Volkerku

    Volkerku

    Joined:
    Nov 23, 2016
    Posts:
    114
    Hi
    Great asset, I try to use it for a fx shot for a VR project. Pre-rendered, not realtime and reversed in post.This is to reconstruct an interior space from pieces, in slow motion.
    Only thing I struggle with, there is a visual jump, just before the structure finished to assemble. Or if not shown in reverse, the moment after the explosion is triggered, the transition from unexploded mesh to exploded mesh fragments is not smooth. You only notice this if the explosion is really slow as in my example.
    A video to demonstrate:
     
  47. Pvt_Hudson

    Pvt_Hudson

    Joined:
    Jan 20, 2016
    Posts:
    41
    just upgraded to Exploder 1.7.8 and get same compile error. (Unity 2017.2.2p4)

    Assets/Exploder/Exploder/Core/Tasks/PartialSeparator.cs(25,35): error CS0117: `Exploder.TaskType' does not contain a definition for `PartialSeparator'

    EDIT: delete Exploder folder, then import new version fixed it.
     
    Last edited: Jun 27, 2018
  48. Kondor0

    Kondor0

    Joined:
    Feb 20, 2010
    Posts:
    601
    Is there a script reference for this? I'm trying to delete all fragments in a scene so I tried using DeactivateFragments but apparently has no effect.
     
  49. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    @Kondor0
    Q: How to access fragment pool and get active fragments?

    A: Please refer to file HowToGetActiveFragments.cs.
     
  50. Kondor0

    Kondor0

    Joined:
    Feb 20, 2010
    Posts:
    601
    I already did that, the method DeactivateFragments is not working.