Search Unity

Exploder [RELEASED]

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

  1. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    this is very promising to hear. I'll be buying it at some point in the future, thank you
     
  2. HellPatrol

    HellPatrol

    Joined:
    Jun 29, 2014
    Posts:
    38
    Does this work with ProBuilder Mesh's in any way?
     
  3. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi, unfortunately not, Exploder works only with Unity meshes, you would have to convert the ProBuilder mesh to standard Unity mesh before exploding it.

    Regards.
     
  4. jjnieto

    jjnieto

    Joined:
    Jun 17, 2014
    Posts:
    36
    Hello,
    First of all congratulations for your awesome asset!

    I'm experiencig a weird error. When I use my own gamneobjects with your exploder script I got sometimes the error:
    !query->pending
    It is completely random when it happens and, as far as I know, some other people are experiencing this error with other assets and scenes.

    What I do is:
    1) Open your first person demo scene
    2) Add some own crates prefabs with the tag Exploder
    3) Run the scene. The first time I run the scene (just with the Unity recently opened) I never ever got this error
    4) Stop the scene and run again... then randomly the error happens when a crate explodes

    Did you got this error sometime? What can cause this error? I have no clue what can happen!!
    It looks like some kind of internal Unity cache or similar, because with Unity restarted never happens.
    Also, if I set the FadeOut to scale down (with a timeout greater thar zero), the error never happens..?!?!?!?

    Please help, I'm getting crazzy :p

    PS: A clue (at last!) If I set the 'Deactivate On' to Timeout and the Timer to zero, the error never happens!
    Another clue... if I set the FadeOut to ScaleDown, the error never happens no matter the timeout time I set... WEIRD!
     
    Last edited: Jan 21, 2015
  5. vexe

    vexe

    Joined:
    May 18, 2013
    Posts:
    644
    Hey there, good stuff! - I was wondering if I could target a certain part of the mesh to explode. Like for ex blow a character head off (just the head), or any other certain part of his body. I believe it's fairly easy to do if the body parts had separate meshes, but I'm talking one mesh here for the whole body. Is it possible?
     
  6. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    thanks for using Exploder!

    !query->pending is an internal Unity error and there is a very little information what is the cause of it. Can you tell me your version of Unity and if you are using DX11? I will try to reproduce the error.

    Regads.
     
  7. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi, unfortunately it is not possible. Local explosions are not supported, you would have to use separate meshes to make it work.

    Regards.
     
  8. jjnieto

    jjnieto

    Joined:
    Jun 17, 2014
    Posts:
    36
    Hello,
    I'm using Unity 4.6 PRO in a Windows (with a GTX880M) Anyway, to avoid this error I simply add the 'fade out'->'scale down' and all works fine.
    Thanks a lot and congratulations again for this great asset
     
  9. BusyRobot

    BusyRobot

    Joined:
    Feb 22, 2013
    Posts:
    148
    I'm new to Unity, working on a 2D game. Few questions.

    1. Is it possible for each of the fragments to be collected by a player character?
    2. Is it possible for the explode to work based upon colors in a sprite? so it would divide it up according to different colored sections? What control do I have on how a sprite gets divided up?
     
  10. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi, thanks for interest in Exploder!

    Exploder works only with meshes and there is no way to cut the mesh based on sprite color. Exploder takes the object, searches for the mesh inside, cuts the mesh based on parameters (number of fragments, etc...) and returns set of new meshes as fragment pieces. The cutting is random, however you can choose number of fragments, velocity, and other, more info is in documentation.

    To collect fragments by player character, that is possible, because the fragments are independent game objects, but you would have to do same scripting to access the fragments from fragment pool and deactivate them manually.

    Also important note, current version of exploder does not work with Unity build in sprites, you have to use Sprite system that is using meshes, like 2D Toolkit. The Built in sprites will be supported once Unity releases API for accessing mesh data.

    Regards.
     
  11. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    Hi
    I use always this great asset.

    I tried to build and run in IL2CPP option in Unity4.6.2p2.
    It crashed in Exploder.Explode ().
    This is error log screenshot.



    Do you have plans to IL2CPP support?

    Regards.
     
    JRRReynolds likes this.
  12. JRRReynolds

    JRRReynolds

    Joined:
    Oct 29, 2014
    Posts:
    192
    @reindeer games, yes any timeline for IL2CPP? -- its addition would be greatly appreciated
     
  13. smasters654

    smasters654

    Joined:
    Dec 20, 2013
    Posts:
    46
    @reindeer games The only thing holding me back from getting this asset is the IL2CPP support. Like the previous two posts I am wondering when or if it will be compatible.

    Edit: I decided to buy it anyway and test it myself. I can confirm it DOES work with IL2CPP on iOS. I am using Unity 4.6.3.
     
    Last edited: Mar 5, 2015
  14. reindeer-games

    reindeer-games

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

    I have been testing IL2CPP and Exploder and most of the issues are related to IL2CPP itself and not Exploder. I found it quite buggy and many asset store developers are encountering similar problem, linking problems, crashes, unsupported networking, etc. Unity is working on an update, so please be patient.

    There is some interesting thread about it:

    http://blogs.unity3d.com/2015/01/29/unity-4-6-2-ios-64-bit-support/

    BTW, yesterday Unity 5 was released and the 64 build of Exploder demos seem more stable. Give it a try.

    Regards.
     
  15. melonhead

    melonhead

    Joined:
    Jun 3, 2014
    Posts:
    630
    is exploder unity 5 compatible, need to know before purchase
     
  16. BusyRobot

    BusyRobot

    Joined:
    Feb 22, 2013
    Posts:
    148
    Few questions.

    1. You mentioned in your replay to me before that it doesn't work with Unity's built in sprites? does it now? Also if not do I have to use 2d toolkit? or I can create them in Unity somehow?
    2. Can I explode the sprites into small squares? like pixels?
    3. Also will this work with spriteTile? will the exploded bits bounce off collider tiles?
     
    Last edited: Mar 11, 2015
  17. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    I would also like to know, thanks
     
  18. melonhead

    melonhead

    Joined:
    Jun 3, 2014
    Posts:
    630
    HeadTrip, i have recieved an email from the author of exploder saying that when he last ran exploder in unity 5 all demos worked fine and that any problems will be fixed if needed.
     
  19. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Cool, thanks!
     
  20. Dazz2000

    Dazz2000

    Joined:
    Apr 27, 2014
    Posts:
    19
    Just wondering if you guys are planning on Upgrading the product for UFPS multiplayer are you part of the MP Beta Test........ ?
     
  21. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi, unfortunately Exploder is not part of the UFPS beta test, but I will look if it can be supported, thanks for info.
     
  22. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi, yes, the target fragment value is a total number of fragments per explosion (not per object). More info about parameters is in documentation:

    https://docs.google.com/document/d/...a9ZJvjwtl7bU/pub?embedded=true#h.x4v1zdp9xaa7
     
  23. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    do you have defined layer in Exploder settings? Also did you use Unity 4 before and now you are using Unity 5? If you have a custom layer in your game (and used by Exploder, check the exploder inspector in section layer), please check it is also defined in Unity layer manager as described here:

    http://docs.unity3d.com/Manual/Layers.html

    Let me know if it works.
     
  24. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Great!
     
  25. Jack_LaSota

    Jack_LaSota

    Joined:
    Mar 30, 2015
    Posts:
    3
    I would like to be able to serialize an exploded mesh without storing all the mesh data in the file, just the random seed, and an array of locations, rotations, velocities, and angular velocities of the fragments. Is there an easy way to make the exploder use the same random seed again? What affects the randomization, besides the seed? This is an armature-deformed mesh, so do I have to put it into the same pose again? Does it have to be in the same place in 3d space?
     
  26. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi there,

    Exploder is setting up random seed on ExploderObject Awake only once and if you use the same value for seed you should get the same result, however the object should be in the same transform because the cutting plane is randomized in global space.

    Code (CSharp):
    1. private void Awake()
    2. {
    3.     // ...
    4.     UnityEngine.Random.seed = System.DateTime.Now.Millisecond;
    5.     // ...
    6.  
    Hope it helps.
     
  27. dansta2k

    dansta2k

    Joined:
    Apr 24, 2015
    Posts:
    12
    Hello Reindeer games

    I really like your plugin, and I can get it mostly working.

    I am having an issue when trying to explode items whilst they are in motion, sometimes they do not explode/destroy. This is not a problem when they are still. Using timers I managed to get this working better but it would still occur seldomly. Is there a better way? In the meantime I am destroying the object with a timer if it doesnt explode.

    Any thoughts?

    Regards
     
  28. melonhead

    melonhead

    Joined:
    Jun 3, 2014
    Posts:
    630
    how to access the expoloder settings with code so that they can be set during runtime and not with the sliders?

    thanks
     
  29. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Very easily, look at the demo example, for example DemoClickExample.cs for detailed info. In short, just create public variable in your script ExploderObject, assign exploder prefab from inspector, adjust the settings, call explode...
     
  30. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Thanks for using Exploder!

    Is it possible that you are exploding more than one object by calling Explode(...) multiple times? If so, exploder put the Explode(...) into internal queue and process the calls sequentially, which might be a problem if the objects are moving really fast.

    This is probably happening, you call multiple Explode(...) in a short period of time:

    Explode(...)
    Explode(...)
    Explode(...)

    Now we have 3 exploders in the queue with positions of current time. When the objects are moving fast, it can happen that the position in the queue is already far from the object you want to explode.

    Now what you can do, you can try to minimize calling Explode in a short period of time, for example by increasing the radius, so one Explode(...) can destroy multiple objects at the same time. Or you can call Explode when the other objects is already Exploded, put the Explode(...) to the callback OnExplosion(...), which is not so universal but should work.
     
  31. dansta2k

    dansta2k

    Joined:
    Apr 24, 2015
    Posts:
    12
    Thanks Reindeer Games

    Yes that is exactly what is happening., I thoguth the solution might be in the callback OnExplosion() however in my head I cant understand why id be calling the explosion on OnExplosion if that is triggered by an explosion in the first place. Is this why you said it was not the most universal?

    I suppose that dynamically setting gameObjects to explodable is the way to go, then a single explosion would explode multiple objects. I will give this a go. Thanks heaps.
     
  32. syruf

    syruf

    Joined:
    Nov 10, 2012
    Posts:
    4
    I have modified meshcutter.cs to support multiple materials per mesh (submeshes) contact me at mindsinkstudioATgmail if interested.
     
  33. alecie

    alecie

    Joined:
    Sep 2, 2013
    Posts:
    73
    Any idea why it can't find ExploderObject in code? I can't call explode without it.

    ---

    Had to add using Exploder, works like a charm, perfect asset ;)
     
    Last edited: Jul 10, 2015
  34. alecie

    alecie

    Joined:
    Sep 2, 2013
    Posts:
    73
    Hey there, I have a problem.

    After exploding an object ExploderObject is being set to inactive so it is impossibile to destroy other objects, is this a bug or I am doing something wrong?

    ---

    Also, some object don't want to explode, I have made them in Blender and imported. Only cubical objects explode like floor or square pillar. Wall with window hole in it doesn't, even though I have selected OpenMeshCutting and SplitMeshIslands.

     
    Last edited: Jul 10, 2015
  35. alecie

    alecie

    Joined:
    Sep 2, 2013
    Posts:
    73
    Ok, I've solved first issue by recreating Exploder object from prefab that you included and second one by centering Exploder on hit object and changing radius to mesh bound radius.

    You can see all the cool stuff here: :)


    Buildings and white cars are made using Exploder and the rest is from DestroyIt.

    I still have got two problems.
    First one, it is very slow (for what I use it). Is it possibile to do mesh decimation on separate thread? I've given it 5ms to do calculations per frame, it still lags and houses are collapsing very slowly.

    Second one is that some objects still don't want to explode, my script runs through all the children twice but you can see some of them are still staying undestroyed. What could cause this?
     
    Last edited: Jul 11, 2015
  36. melonhead

    melonhead

    Joined:
    Jun 3, 2014
    Posts:
    630
    make sure all objects are closed hull or you will get problems
     
  37. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    thanks for using Exploder!

    To answer your questions:

    1) Using different thread for calculation isn't really in the plan. It would bring new problems and most likely slow down the start of explosion. 5ms frame budget is quite low, did you try higher number, you can try to set it up to half of your average framerate, default is 15. Also try not to use SplitMeshIsland, since this feature can be slow on some meshes.

    2) Try to set the exploder to the center of the mesh before calling explode, there is a utility function ExploderUtils.GetCentroid(...) that should give you the center of the object. You can look at the DemoClickExplode.cs and use similar technique in your game.

    Regards,
    RG
     
  38. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    THIS should be in the TODO list for all publishers who have products like this one. As a customer (i own your tool) it's always a good new to know that the product will evolve to better performances. :oops:
     
    Last edited: Jul 14, 2015
  39. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Don't get me wrong, using multiple threads for Exploder wouldn't improve the performance, I did experiments in past and I have a good reason to go single threaded only:

    1) UnityEngine is not thread-safe, even you can create a thread in .NET, you cannot access Unity data, so you would have to copy mesh data back and forward from main thread to your worker thread, which is not cheap.

    2) Creating a new thread is not cheap either, http://stackoverflow.com/questions/5626803/why-is-creating-a-new-thread-expensive

    3) Same with thread synchronization.

    All these things takes lots of time and even more on mobile platforms and Exploder was designed to run in run-time as fast as possible, every function was profiled and optimized to take as little milliseconds as possible etc. Multithreading is good but not suitable for every application. Exploder works great with many objects and cuts objects quickly with reasonably settings, adding more threads would just increase the overhead.

    I think the only way of improving the performance is to go the GPU way like NVIDA is trying to do:
     
    hopeful likes this.
  40. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Thanks.
     
  41. CrypticError

    CrypticError

    Joined:
    Jul 11, 2015
    Posts:
    2
    Hi, could you possibly add an option for the exploder to only affect part of the mesh, like above a certain Y value? Im trying to use this to explode building like structures to represent their health, but I don't want the building 100% destroyed in one go. Also, if you could add a way for the exploded particles to be removed after x seconds, that would be awesome
     
  42. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi, local destructions are not supported, you can only destroy whole object, it's quite a complicated problem. However the option for particles is an easy one, I will add it to next update.
     
  43. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I've had this asset for a while, but never really did much with it. Now I'm using it for a fun little action game where you can run around and smash things, and I'm loving it!

    But I'm not satisfied with my fragment deactivation options. What I want is for smaller fragments to deactivate more quickly than big ones — and big enough ones should never deactivate. Also, fragments outside the camera view should count down to their deactivation time faster.

    All that is too much to expect from the built-in code, so what I really want is this:

    Is there any way to take control of fragment deactivation myself, short of hacking the Exploder code?

    I'm thinking about something like, an interface that Exploder Object looks for on the same game object. Any component implementing that interface gets called with each new fragment created (or reactivated from the pool), so it can tweak the settings or attach a custom script or whatever.

    Or is there already some way to customize each fragment, that I've simply missed?
     
  44. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Hmm, actually, I guess I could just pass a callback to the Explode call, and then use FragmentPool.Instance.GetActiveFragments to make sure all the fragments are configured as I want them. I'll try that first, since it doesn't require hacking the code!

    But another approach you might consider for future versions: add a "public GameObject fragmentPrefab" property to the FragmentPool class. Then check for that, and instantiate it instead of just making a new GameObject when creating your fragments. This would let us customize the fragments created any way we like, and is much simpler than what I was proposing before!
     
  45. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi, thanks for using the asset!

    public GameObject fragmentPrefab is a really good idea, I will include it in the next update, for your current problem the best way is exactly how you found out, use the Explode(...) callback and get active fragments after explosion. Just remember that in the next explosion some fragments will be re-used.

    Thanks for the feedback.
     
  46. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    I will add it, this can be useful.

    Thanks for the feedback.
     
  47. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    a new version was uploaded to AssetStore (1.3.15).

    Features:
    • Particles timeout option
    • Cube radius (explode objects withing a cube)
    • Crack with transform (now the crack can be executed on moving object)
    • Custom fragment prefab (option for using custom object for fragment pieces)
     
    JoeStrout likes this.
  48. jayglossy

    jayglossy

    Joined:
    Aug 20, 2013
    Posts:
    7
    Hi
    Thanks for this great asset!
    i have been using it for a few weeks now (works great) with playmaker
    after updating my playmaker yesterday i started getting errors everywhere i used the Explode Playmaker action
    "could not create action: Explode (Maybe script was removed?)"
    Any ideas as to how to fix this?
    Thanks
     
  49. GrahamH

    GrahamH

    Joined:
    May 5, 2014
    Posts:
    6

    From the documentation...
    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
     
    jayglossy likes this.
  50. GrahamH

    GrahamH

    Joined:
    May 5, 2014
    Posts:
    6
    Love the asset - but have got a problem that I can't work out.

    You've provided the option to add an 'Explodable' script instead of using a tag. Since my objects mostly already have a functioning tag being looked for in my other code, I thought I'd follow the 'Explodable' script option.

    On the Exploder object options, I click the checkbox for 'Ignore Tag' and then add the 'Explodable' script to the gameobject I wish to explode.

    When hit, my gameobject explodes correctly as expected, but then I get repeat hits even though the object has gone.

    What seems to be happening is the 'Explodable' script is automatically added to the Exploder sphere.

    This has the undesired affect of making the exploder sphere 'explodable' in itself. Subsequent hits from the raycast act as though the exploder sphere is a target in itself and so I'm getting repeat explosion sounds and particles etc, even though the original target has gone.

    Thought I'd check this with your example scenes and again, once I press run, the 'Exploder' script gets added to the exploder object.

    Any ideas? Have I messed something up here?

    Would really prefer not have to recode my other scripts to make the tag option available to exploder.