Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Exploder [RELEASED]

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

  1. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    thanks for using Exploder!

    To answer your questions:

    1) You can do this 2 ways, either change "TargetFragments" on Exploder singleton "ExploderSingleton.ExploderInstance.TargetFragments = XXX"

    or

    instead of using prefab/singleton assign ExploderObject directly to your object and set parameters for your model only. Then you have to call something like this: "GetComponent<ExploderObject>().ExplodeObject(gameObject)"

    2) Hmm, I don't think the fragments get exploded automatically, is it possible OnCollisionEnter is called multiple times? Perhaps you can add one boolean variable and make sure that ExplodeObject(this.gameObject) is called only one time.
     
  2. Sawula

    Sawula

    Joined:
    Aug 21, 2013
    Posts:
    12
    1) So if I use the singleton, it changes for all prefab. If I want to change only for one item, I have to put the exploder script on this item, is that it?

    2) I tried the boolean, it helped a bit, but the fragments still exploded in chains way too fast, so I increased the minimum speed required to activate the explosion. This helped too, now it's doing more o less what I want :)

    EDIT: After more playing around I realised what was happening, the fragments don't explode too fast, they're getting re-used too fast! The pool is too small, with all the exploding item I have on screen, so it re-use fragments from the first exploded items to do the latest explosion.
    I set up the pool size to its maximum, but is there any way to get it higher than 1000?

    thanks for the help ^^
     
    Last edited: Feb 20, 2017
  3. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    1) Yes, that's correct. You can still use singleton but you have to manually change the settings before explosion.
    2) You can override the pool size limit in the script, but 1000 is a lot already :)

    Open "EditorExploderObject.cs" and go to line 205, there should be this line:

    Code (CSharp):
    1. change |= EditorExploderUtils.SliderEdit("Pool Size", "Size of the fragment pool, this value should be higher than TargetFragments.", 0, 1000, poolSize);
    Change 1000 to anything you like.
     
  4. Sawula

    Sawula

    Joined:
    Aug 21, 2013
    Posts:
    12
    Perfect this was indeed the whole problem! And yes, 1000 is already a lot, I probably won't need much more anyway, but it's good to know why it was doing this XD
     
  5. Orizz81

    Orizz81

    Joined:
    Oct 18, 2013
    Posts:
    11
    Hi there,
    I purchased this asset today and its really cool!
    I'm having problems with crackobject though.

    1. I'm referencing the singleton and adding 10 gameobjects using CrackObject
    2. When I explodecracked 9 of the objects disappear each time explode is called and the 10th object shatters as expected.
    Any ideas why this is happening? If it because I'm using 10 prefabs of the same model?

    Thanks
     
  6. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi!

    Very strange, are you cracking 10 different game objects? Or you apply the crack directly on the prefab? I have never seen this problem before, it is possible it has to do something with the prefab. I will test it out.
     
  7. ASPLADMIN

    ASPLADMIN

    Joined:
    Sep 8, 2016
    Posts:
    4
    Hi,

    I have an Object to Explode and wish to Crack it beforehand.

    Created this script and attached to GameObject to be exploded.

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using Exploder;
    using Exploder.Utils;
    public class VehicleDestruction : MonoBehaviour {
    void Awake()
    {
    ExploderSingleton.ExploderInstance.CrackObject(transform.gameObject);
    }
    public void destroyVehicle()
    {
    ExploderSingleton.ExploderInstance.ExplodeCracked(transform.gameObject);
    }
    }

    Now when destroyVehicle() is called I get following error...

    GameObject LAV25_v5 Testing not cracked, Call CrackObject first!
    UnityEngine.Debug:LogErrorFormat(String, Object[])
    Exploder.CrackManager:Explode(GameObject) (at Assets/Exploder/Exploder/Core/CrackManager.cs:44)
    Exploder.Core:ExplodeCracked(GameObject, OnExplosion) (at Assets/Exploder/Exploder/Core/Core.cs:97)
    Exploder.ExploderObject:ExplodeCracked(GameObject) (at Assets/Exploder/Exploder/ExploderObject.cs:521)
    VehicleDestruction:destroyVehicle() (at Assets/Core/ALS/BattleAI/VehicleDestruction.cs:16)

    Any idea what I am doing incorrectly?

    Thanks!
     
  8. Orizz81

    Orizz81

    Joined:
    Oct 18, 2013
    Posts:
    11
    Ok thanks for looking into this, I'm using the standard Ethan character from 'Standard Assets'
    Please let me know so I can get on with integrating into my project

    Thanks
     
  9. VoidFish

    VoidFish

    Joined:
    Nov 27, 2012
    Posts:
    30
    Hello, I recently bought the Exploder from the Unity asset store. A few of my users have been reporting crashes (CTD) since I added it. Not all users, and I haven't run into it myself. I have output logs, error logs, and crash dumps.

    The stack trace:
    ========== OUTPUTING STACK TRACE ==================

    0x7657338D (KERNELBASE) DebugBreak
    0x1010D9ED (mono) unity_mono_method_is_generic
    0x1010DA27 (mono) unity_mono_method_is_generic
    0x1010AF9B (mono) unity_mono_method_is_generic
    0x1010B7E6 (mono) unity_mono_method_is_generic
    0x1010B922 (mono) unity_mono_method_is_generic
    0x1010A932 (mono) unity_mono_method_is_generic
    0x1010AB70 (mono) unity_mono_method_is_generic
    0x1010AC54 (mono) unity_mono_method_is_generic
    0x1005EF80 (mono) mono_array_new_specific
    0x069105CB (Mono JIT Code) (wrapper managed-to-native) object:__icall_wrapper_mono_array_new_specific (intptr,int)
    0x0BAA5CAB (Mono JIT Code) System.Collections.Generic.List`1<UnityEngine.Vector4>:ToArray ()
    0x0BA9E590 (Mono JIT Code) Exploder.MeshCutter:Cut (Exploder.ExploderMesh,Exploder.ExploderTransform,Exploder.Plane,bool,bool,System.Collections.Generic.List`1<Exploder.ExploderMesh>&)
    0x0BA98147 (Mono JIT Code) Exploder.MeshCutter:Cut (Exploder.ExploderMesh,Exploder.ExploderTransform,Exploder.Plane,bool,bool,System.Collections.Generic.List`1<Exploder.ExploderMesh>&,UnityEngine.Color,UnityEngine.Vector4)
    0x0BAA6BB0 (Mono JIT Code) Exploder.CutterWorker:Cut ()
    0x0BA4C11F (Mono JIT Code) Exploder.CutterWorker:ThreadRun ()
    0x0691E571 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
    0x100F1716 (mono) mono_set_defaults
    0x1005D82C (mono) mono_runtime_invoke
    0x1005DC48 (mono) mono_runtime_delegate_invoke
    0x1007F293 (mono) mono_thread_interruption_request_flag
    0x1010C7CA (mono) unity_mono_method_is_generic
    0x7489336A (kernel32) BaseThreadInitThunk
    0x76F49902 (ntdll) RtlInitializeExceptionChain

    ========== END OF STACKTRACE ===========


    Any idea what's going on?
     
  10. P4p3Rc1iP

    P4p3Rc1iP

    Joined:
    Feb 17, 2015
    Posts:
    13
    Hi, thanks for making this plugin, it's exactly what we need for our project!

    We want to have different explosion properties for various objects, however, I am running into a problem: When an object explodes it seems to create fragments from the mesh twice! If you set it to, say, 2 fragments, it simply duplicates the original mesh. If you set it to 3 fragments, you get 2 "halves" of the original mesh, and 1 "whole". If you set it to 4 fragments, you get 4 "halves" (or 3 1/3rds and 1 "whole"), etc. etc.

    Our setup is as follows:
    I attatched the Exploder Object component to each prefab we want to instantiate and destroy. The settings have been set to destroy self with radius disabled and meshcolliders enabled. The fragment count is set relatively low (around 5, but it doesn't seem to matter much, it only gets more obvious when it is low and with little explosion force).

    Here's a repro project:
    https://www.dropbox.com/s/08espfu41kqyv1o/ExplodeTest.zip?dl=0
    Simply select one of the standard meshes in the scene and toggle "explode".

    Edit: Ok, so when I call ExplodeObject() from outside the gameobject it works fine (as in the demo scene). It only appears to happen when call ExplodeObject(this.gameObject), like when for example an object reaches 0 hitpoints and explodes itself. Of course I could work around this issue, but I don't understand why this should be a problem in the first place...

    Additionally, I'm running into these errors occasionally:

    Code (CSharp):
    1. ConvexHullBuilder: convex hull has more than 255 polygons!
    2. UnityEngine.GameObject:SetActive(Boolean)
    3. Exploder.ExploderUtils:SetActiveRecursively(GameObject, Boolean) (at Assets/Exploder/Exploder/Utils/ExploderUtils.cs:140)
    4. Exploder.Fragment:Explode(ExploderParams) (at Assets/Exploder/Exploder/Fragments/Fragment.cs:347)
    5. Exploder.PostprocessExplode:Run(Single) (at Assets/Exploder/Exploder/Core/Tasks/PostprocessExplode.cs:154)
    6. Exploder.Core:RunTask(TaskType, Single) (at Assets/Exploder/Exploder/Core/Core.cs:247)
    7. Exploder.Core:Update() (at Assets/Exploder/Exploder/Core/Core.cs:158)
    Code (CSharp):
    1. Gu::ConvexMesh::loadConvexHull: convex hull init failed! Try to use the PxConvexFlag::eINFLATE_CONVEX flag. (see PxToolkit::createConvexMeshSafe)
    2. UnityEngine.GameObject:SetActive(Boolean)
    3. Exploder.ExploderUtils:SetActiveRecursively(GameObject, Boolean) (at Assets/Exploder/Exploder/Utils/ExploderUtils.cs:140)
    4. Exploder.Fragment:Explode(ExploderParams) (at Assets/Exploder/Exploder/Fragments/Fragment.cs:347)
    5. Exploder.PostprocessExplode:Run(Single) (at Assets/Exploder/Exploder/Core/Tasks/PostprocessExplode.cs:154)
    6. Exploder.Core:RunTask(TaskType, Single) (at Assets/Exploder/Exploder/Core/Core.cs:247)
    7. Exploder.Core:Update() (at Assets/Exploder/Exploder/Core/Core.cs:158)
    Code (CSharp):
    1. Failed to create Convex Mesh from source mesh "". Source mesh is likely have too many smooth surface regions. Please reduce the surface smoothness of the source mesh. Alternatively turn on Inflate Mesh and increase the Skin Width sufficiently for this mesh.
    2. UnityEngine.GameObject:SetActive(Boolean)
    3. Exploder.ExploderUtils:SetActiveRecursively(GameObject, Boolean) (at Assets/Exploder/Exploder/Utils/ExploderUtils.cs:140)
    4. Exploder.Fragment:Explode(ExploderParams) (at Assets/Exploder/Exploder/Fragments/Fragment.cs:347)
    5. Exploder.PostprocessExplode:Run(Single) (at Assets/Exploder/Exploder/Core/Tasks/PostprocessExplode.cs:154)
    6. Exploder.Core:RunTask(TaskType, Single) (at Assets/Exploder/Exploder/Core/Core.cs:247)
    7. Exploder.Core:Update() (at Assets/Exploder/Exploder/Core/Core.cs:158)
    I haven't really been able to get these consistently in my actual project, though it does do it 100% repro on the Sphere and Capsule in the repro project...
     
    Last edited: Feb 27, 2017
  11. Orizz81

    Orizz81

    Joined:
    Oct 18, 2013
    Posts:
    11
    Hi there, is there any update on my issue? I haven't been able to use this asset yet

    Paul
     
  12. Shtrude1

    Shtrude1

    Joined:
    Nov 5, 2016
    Posts:
    15
    Hi,

    Is it possible to implement "tiling mechanic" to cross section UV for exploder option?
    Because in some cases that part i take from the texture is quite low rez and i want to tile it for example 5 times so it gets at least a little bit of quality to it.
     
  13. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    try to call crack on Start() and not Awake(). Calling it on Awake() could be made before Exploder initialisation.
     
  14. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi! Thanks a lot for the stack trace, I am looking into it. What platform is it? Can you send me all the details include the crash dump in PM?
     
  15. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    H
    Hi, yes, it's a bug in crack system, it's not related to prefabs, but skinned meshes. Because it works properly with normal meshes. I will be releasing fix in the next update.
     
  16. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    thanks for the project in drop box, just downloaded...

    I see you have enabled "MeshColliders", there are certain limitations in mesh colliders. There are very slow and the mesh can't bee too complex. The error you are getting is Unity internal error trying to create mesh collider from one of the fragment meshes. It's possible that after several cuts the mesh is too complex and Unity can't use it as a mesh collider anymore. Do you need to use mesh colliders in your project? I will look if the error can be fixed but can't guarantee since it's Unity internal function.
     
  17. P4p3Rc1iP

    P4p3Rc1iP

    Joined:
    Feb 17, 2015
    Posts:
    13
    Hi,

    Yeah we kinda do need mesh colliders. We want to dynamically "blow up" asteroids, but only cut them into something like 4-8 fragments so they can slowly drift apart instead of shattering in lots of bits that fly everywhere. So far we only rarely get the error.

    For us a solution would be that it does try to create a mesh collider, but if it fails it simply ignores it. A fragement without a collider is less noticable than one with a wrong collider, potentially causing other glitchy behaviour.

    As for my other issue:
    This was due to me being stupid and is since resolved :)
     
  18. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Okay,

    I will look if I can add a fallback for failed mesh colliders.
     
  19. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    it's not possible with the current version since it uses a single texture for the whole mesh and turning on tiling would affect the whole mesh/texture. I believe tiling would work only if the cross-section is a sub-mesh and the texture is a separate material.
     
  20. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    please check version 1.7.2, should be live in few hours on the store, the bug has been fixed.
     
  21. Orizz81

    Orizz81

    Joined:
    Oct 18, 2013
    Posts:
    11
    Thank you, I'll keep my ear to the ground
     
  22. Murkawski

    Murkawski

    Joined:
    Nov 30, 2014
    Posts:
    48
    Hi,

    objects disappear for a fraction of a second before exploding if I use following settings:

    1. Uniform distribution => true
    2. Cutting Plane Angle => Rectangular Random

    Any chance you could look into it?
     
  23. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    I was testing this settings with my demos and I haven't seen any object disappearance. Could it something specific to your project? What kind of mesh are you trying to explode? What script do you use? Maybe you can send me more details with screenshots.
     
  24. Sawula

    Sawula

    Joined:
    Aug 21, 2013
    Posts:
    12
    Hello, it's me again

    I got a new question
    I'm trying to setup a system with different explosion on different item. I gave each item the exploder script to be able to change the parameters easily. This work perfectly fine.

    But when I try to give them different fragment prefab, it doesn't work. They all refer to the same one (the first I gave apparently) The pool spawn for only one of the exploder too, but they all use that one pool.
    So a direct exemple:
    I have a wood object and a stone object. I give each the exploder script. I set up the script to blow the wood in 10 fragments and the stone in 5. I also set up to have the wood explode in "wooden fragments" and the stone explode in "stone fragments" (both prefabs I have). The wood is supposed to burn (disappear after a few moments), the stone can be exploded again. So I set the wood with a lifetime and the stone with "explodable fragments".
    Finally I set up a material for each (brown and gray)
    I go in game, explode the two object.
    I only obtain only brown fragments. The right amount for each object. They do not explode again (as the stone should)
    When I check the pool it only has wooden fragments in it.

    What am I doing wrong?
     
  25. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    you are right, that's a limitation in the current version, I will make a fix so you will be able to create different FragmentPrefab for different ExploderObject script.

    Thanks for the feedback.
     
  26. Sawula

    Sawula

    Joined:
    Aug 21, 2013
    Posts:
    12
    Alright, glad to be useful ^^
    Until the fix is released though is there a way to activate specific bool in the fragments, when the explosion happens, depending on what they exploded from?

    Like, if I explode the stone, I activate the "Stone" bool on all my fragment so they behave like stone
    If I explode the wood, I activate the wood bool
    etc etc
    That way i would put one script on all my fragments and just activate the parts I need depending on what object was exploded?

    So in short, is there a way to say "explode this.gameobject" "Get this.gameobject.tag" "Activate corresponding bool in fragments" to the code?
     
  27. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Well, you can access active fragments, so after you get your explosion, you can call

    Code (CSharp):
    1. var list = FragmentPool.Instance.GetActiveFragments();
    You can look at the full example in file "HowToGetActiveFragments.cs". When you have the list you can access the custom fragment components and set the flag you want. Is this something that can solve your problem?
     
  28. Sawula

    Sawula

    Joined:
    Aug 21, 2013
    Posts:
    12
    Okay so I couldn't find the file because I hadn't done the update of the package
    but now I did it, it's very weird, I have tons of weird errors, like a fragment clone that appear in my scene but doesn't have a rigidbody or mesh renderer

    and I can't change pick which prefab to use as fragment prefab, the script use a specific prefab (this is a strange change, the earlier version was better on this)
     
    Last edited: Mar 10, 2017
  29. K0m1x

    K0m1x

    Joined:
    Aug 19, 2013
    Posts:
    26
    hey, I ve been using the exploder for a while in my game development, it seems cool. I just updated to the latest version which I ahvent done in years... and now it seems to cause errors when I restart the scene using the reload active scene command.

    here is the error it gives me:
    NullReferenceException: Object reference not set to an instance of an object
    Exploder.ExploderObject.Awake () (at Assets/Exploder/Exploder/ExploderObject.cs:424)
    UnityEngine.Object:Instantiate(Object)
    all:Start() (at Assets/Scripts/all.cs:1297)

    also exploder wont work after this error. I gotta fully restart the build for it to work again.
     
  30. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi, how do you reload active scene?

    I tried this and it seems to be working well:

    Code (CSharp):
    1. UnityEngine.SceneManagement.SceneManager.LoadScene(0);
     
    Last edited: Mar 13, 2017
  31. K0m1x

    K0m1x

    Joined:
    Aug 19, 2013
    Posts:
    26
    I use Application.LoadLevel(Application.loadedLevel);
    which seems to work the same.

    I guess the main issue is that I run this script before resetting the scene:

    GameObject[] objects = FindObjectsOfType(typeof(GameObject)) as GameObject[] ;
    for (int e=0;e<objects.Length;e++){
    g1=objects[e];
    Destroy(g1);
    }
    so maybe the problem is that I destroyed something that it's using?
    and the old version of the exploder used to work regardless.
     
  32. K0m1x

    K0m1x

    Joined:
    Aug 19, 2013
    Posts:
    26
    and now that disabled that code that removes all object something else happens... all the fragments remain in the scene after the restart, lol how odd. so I guess something makes the exploder persist thru the restart, that must be the issue.
    any way I can turn that off?
     
  33. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    sorry for the late reply, I missed notification from your post. The fragments are persistent even after scene reload because the fragment pool is set as "DontDestroyOnLoad". If you want to disable this behavior you can comment that call in FragmentPool.cs in Awake() method.

    The error you mentioned earlier is indeed because you destroyed all objects in the scene, there is an object "ExploderCore" which must be kept in the scene. It's better for performance reasons. You can modify your script by adding this exception:

    Code (CSharp):
    1.  
    2. GameObject[] objects = FindObjectsOfType(typeof(GameObject)) as GameObject[];
    3. for (int e = 0; e < objects.Length; e++)
    4. {
    5.       if (objects[e].name != "ExploderCore")
    6.       {
    7.            Destroy(objects[e]);
    8.       }
    9. }
    10.  
     
  34. K0m1x

    K0m1x

    Joined:
    Aug 19, 2013
    Posts:
    26
    awesome, commenting that "DontDestroyOnLoad" solved all my problems. sparing the exploder core helped so that's good. also glad to learn that "DontDestroyOnLoad" exists, cause I was wondering how to do that.
     
    reindeer-games likes this.
  35. tosvus

    tosvus

    Joined:
    Dec 27, 2016
    Posts:
    38
    @reindeer-games I have a quick question for you or anyone else reading: This looks great but the visuals in my upcoming game has a very blocky style, so I would like (fairly blocky) objects to break into tiny cubes. Is this possible?
     
  36. K0m1x

    K0m1x

    Joined:
    Aug 19, 2013
    Posts:
    26
    I think you can actually change the angles of the cutting in a way that should give you little cubes.
     
  37. tosvus

    tosvus

    Joined:
    Dec 27, 2016
    Posts:
    38
    Thanks, much appreciated!
     
  38. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    tosvus likes this.
  39. t-ley

    t-ley

    Joined:
    Mar 6, 2017
    Posts:
    8
    when I did the playmaker scripts (changed the classes and also made from mono, they said the scripts had errors and wouldn't play if there for playmaker why not make them complete?
     
  40. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    to use Playmaker you have to uncomment playmaker definition macros inside Exploder folder "Assets/Exploder/Playmaker/*", for example open file "ExploderObjectAction.cs" and uncomment second line, so instead of this:

    Code (CSharp):
    1.  
    2. // uncomment next line to work with Playmaker
    3. //#define PLAYMAKER
    4. #if PLAYMAKER
    5.  
    you will have this:

    Code (CSharp):
    1.  
    2. // uncomment next line to work with Playmaker
    3. #define PLAYMAKER
    4. #if PLAYMAKER
    5.  
    Make sure you have prefab inside the scene and you will be able to run Playmaker actions (you can find them under "effects" category.

    Let me know if you have more problems.
     
  41. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Hi,

    I've been using Exploder on the same project for quite a while. At some point I had made a change to the source to allow certain parts of a GameObject hierarchy to not be affected by an explosion. The scenario is I've got spaceships with shield meshes, and I want to explode the ship hulls, but not have the shield meshes explode into pieces (looks terrible).

    The shield meshes are just sphere meshes that at the time of the explosion are in a child GameObject hierarchy that's inactive. But when the thing explodes, the shield mesh breaks up into pieces and is visible.

    I've updated Exploder since that change (I guess I forgot I made that change!), and don't remember what I did.

    Since there have been a number of changes to the asset over the years, I was wondering if there's already a way to accomplish that. Otherwise, I may need to dig in again and change it to do what I want. Ideally, only the hierarchies with Explodable.cs attached to the parent would be affected.

    Thanks!
     
  42. cj31387

    cj31387

    Joined:
    May 23, 2012
    Posts:
    141
    Is there any way to force multiple explosions at once? I have a gore system where my enemy has dismemberable limbs. Each Limb has a gore system on it, if it takes enough damage I call the exploder singleton explodeobject and explode that limb. But It only will explode 1 thing at a time, which makes my Rocket Launcher gun useless. Is there any way to force multiple explosions with explode object at the same time or que up explosions? Thanks!
     
  43. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi, queueing of explosions is automatic, you can do this:

    ExplodeObject(limb0);
    ExplodeObject(limb1);
    ExplodeObject(limb3);

    and all limbs will be exploded in sequential order.

    In the next update (sometimes this week) there will be a function ExplodeObjects(List<GameObject> objs); to explode multiple objects at the same time.
     
  44. Braddas

    Braddas

    Joined:
    Jun 9, 2013
    Posts:
    25
    Hi,

    I'm making a VR game with exploder and want to use the crack() functionality to make sure I get the best performance. I'm basically cracking anything explodable when the level loads, then exploding them when needed. This is working fine unless the objects move (which they all will). If the object has moved the fragments don't appear at the correct place. Am I doing anything wrong or should I be able to move cracked objects? If all else fails I can try to move the fragments to the correct location after they've been spawned but I'd rather not if I can avoid it.
     
  45. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    yes, you should be able to move cracked objects unless something is wrong, let me do a quick test of the latest version and I get back to you.
     
  46. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi, I tested the crack with object moving and it appears correctly in my demos. I cracked several objects on start, moved them around and exploded them. Everything seems to be correct. Only minor issue is when cracking skinned mesh (animated mesh) it creates fragments at the moment of the animation pose which might be different from the time of explosion, but there is no other way around this.

    Where are your fragments in the moment of explosion? Did they return to the original state of crack? Or they are just somewhere else?
     
  47. Braddas

    Braddas

    Joined:
    Jun 9, 2013
    Posts:
    25
    Looks like I got my code wrong. I was moving the exploder transform to the mesh position when exploding rather than cracking. Apologies for taking up your time with that. The asset's great, I'm really pleased with it.
     
  48. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    No problem, I am glad you have it working.
     
  49. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    170
    Bug: If I don't use the tag but instead use the ExplodableComponent Unity will log an error here:

    if (settings.FragmentOptions.ExplodeFragments)
    {
    tag = ExploderObject.Tag;
    }

    This is with me never defining that tag in the Unity project settings.

    Tag: E is not defined.
    UnityEngine.Component:set_tag(String)
    Exploder.Fragment:Explode(ExploderParams) (at Assets/Exploder/Exploder/Fragment.cs:357)
    Exploder.PostprocessExplode:Run(Single) (at Assets/Exploder/Exploder/Core/Tasks/PostprocessExplode.cs:154)
    Exploder.Core:RunTask(TaskType, Single) (at Assets/Exploder/Exploder/Core/Core.cs:247)
    Exploder.Core:Update() (at Assets/Exploder/Exploder/Core/Core.cs:158)
     
  50. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Thanks a lot, I will check it out.
     
unityunity