Search Unity

Ultimate Fracturing Destruction editor extension for Unity 3D

Discussion in 'Assets and Asset Store' started by UGTools, May 30, 2013.

  1. DrDigg0R

    DrDigg0R

    Joined:
    Apr 7, 2013
    Posts:
    30
    Hi,

    I use the F&D extension for my mobile project too - of course at a point to much colliders and rigidbodies are in the scene and the mobile device gets to slow to calculate them. I've decided to give the Physics to Animation (PTA) Tool a chance and downloaded it from the asset store. Just finished fixing all the bugs from this extension. Every variable name starts with an upper case letter, a lot of "GetComponent" functions don't work and some more problems - in short, the code of PTA tool is outdated javascript. Additionally I encountered a problem as PTA assumes all objects which should be part of the animation are children of a game object, but also stay children - so all fractured objects part of the animation needs to stay active an stay a child of the same game object. However, with my (pretty dirty) fix and an extra script which assures that all chunks stay a child, I managed to record my first animation from the physics reaction caused of F&D. If somebody wants to use the combination of these two extensions and encounter troubles, I don't mind a PM.
     
  2. wiseowlstudios

    wiseowlstudios

    Joined:
    Feb 13, 2011
    Posts:
    741
    Hi i was just wondering is it possible to set it so chunks dont collapes into "dust" eg you shoot legs off the statue but it just falls and maybe chips/damages the rest of its "health" but the statue stays intact otherwise
    Another example is breaking a building but it doesnt collapse unless all load bearing pillars go
    here a vid of the sort of thing i mean -red fraction
     
  3. Baldwin

    Baldwin

    Joined:
    Apr 1, 2014
    Posts:
    37
    Can you tell me how to change the speed of the break animation? Its kinda slow for me....
     
  4. Baldwin

    Baldwin

    Joined:
    Apr 1, 2014
    Posts:
    37
    Also, this thing is crashing. I dunno why but I crashes in .exe and not in the unity editor... Am I doing something wrong?
     
  5. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi Baldwin,

    Which scale are you using? Unity assumes 1 unit = 1 meter because gravity is set to -9.8 m/s^2.

     
  6. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Can you send me a sample scene?

     
  7. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi wiseowlstudios,

    Collapsing into big/single blocks and then fracturing into smaller chunks when hitting the ground is in our to-do list.
    The pillars thing is already implemented, you can check it in the first scene of our webdemo :)


     
  8. Baldwin

    Baldwin

    Joined:
    Apr 1, 2014
    Posts:
    37
    I have no idea. I can't change the gravity then?? What c
    I do to speed up the animation.
     
  9. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    It is easy to know. What kind of objects do you have in your scene and how big are they in units?
    Gravity can be changed in edit->project settings->physics in any case...

     
  10. dabaq

    dabaq

    Joined:
    Apr 20, 2014
    Posts:
    14
    I can't figure out how to use this with playmaker. I've made a fractured cube, made it static, and now my mission is to click on the cube and it will be fractured. How do I do that?
     
  11. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hello dabaq,

    Send me an e-mail to info@ultimategametools.com and I will send you some actions you can use with playmaker. Can you please detail me what you are looking for?

     
  12. dabaq

    dabaq

    Joined:
    Apr 20, 2014
    Posts:
    14
    Thanks for the reply, I've sent an email to the link you've provided.
     
  13. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    How does this perform under iOS?

    What does this mean exactly?
    "Includes our Mesh Combiner utility to enable compound object fracturing as well."

    I was thinking something really cool that could be done with this, and also concerning iOS performance. If you look at the MeshBaker2 system in the asset store, you can load in a bunch of animated, separated mesh transforms, then it will combine those meshes it one mesh, and place a single bone representing each of the transforms, then animate those bones so the now combined group of meshes will still animate around the same way they did as separate meshes and transforms. This lets you take a bunch of animated meshes, and group them, retaining animation, but all of those animated meshes being drawn with 1 draw call.

    Made me thing that it'd be cool if this system could do something similiar. Where you could load a model into the editor, then it would pre-fracture the mesh, and pre-calculate the physics animation. Then it would combine all those fractured mesh pieces into one skinned mesh, then bake the physics simulation animation onto it. So then you would have an object that is just a skinned mesh, with an animation, and you could call .Play() on it and it would explode and fracture.

    That would be cool.
     
    Last edited: Apr 24, 2014
  14. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Can I animate an object and let it impact something along the path? say, throw a rock and it breaks apart as it passes into a wall?
     
  15. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    It performs perfectly under iOS. Of course you need to take into account the same things as in any other mobile environment. Be careful with too many objects, etc.

    The fracturing system works by assigning the component to a single object. If you want to blow up a whole hierarchy of objects you can use the included mesh combiner tool to combine many objects, each with its own materials, into a single one that you will use as input of the fracturer.

    Regarding your optimization idea, the precomputed physics thing is indeed in our to-do list. Hopefully we can implement it in the near future :)
     
  16. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Yes, you can :)

     
  17. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Any suggestions on how? I tried a standard animated path, it just intersects and doesn't break when it collides. I would love a way to throw my asteroid against a cliff side wall, SMASH! I love the audio aspect of this tool as well.
    Edit: Going to use my object as a projectile into the breakable mesh for now...
    thanks!
     
    Last edited: Apr 28, 2014
  18. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    any thing about LOD Groups support?
    and i realized that this just takes the drawcalls upward from like 50 to 1000... any optimizations in near NEAR update?
     
    Last edited: Apr 27, 2014
  19. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    BUMP.
     
  20. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
  21. MihaiVladan

    MihaiVladan

    Joined:
    Dec 17, 2013
    Posts:
    6
    Hi, just bought the asset , played a bit with it and i absolutely love it . I was wondering if you could help me out with a small issue : i have a rigidbody that collides with a fractured object ( just like in your video here http://youtu.be/lxn0P-LkBsA?t=2m9s , the sphere hits the wall ) . What i would like to do is make the rigidbody continue its path and not stop or bounce off once it hits the fractured object. Any way to to set this up ?

    Thanks
     
  22. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hello there!

    Right now, because the way it works, you would need to manually force the object to continue its path. This is because initially all chunks are kinematic and are switched to dynamic once the object hits the chunks (which takes one frame). There is no other optimized way to do this, and it has this little drawback :)

     
  23. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Sorry guys! I skipped this messages. I don't seem to get new mail notifications if I get new posts until I read the forums....
    I'm no sure if LOD groups could be a solution regarding optimization. I would rather try to decrease drawcalls by making inanimated chunks static, so that batching could take better care of them.
    This could be done in a near update, I will keep you posted :)

     
  24. popawheelie

    popawheelie

    Joined:
    May 27, 2013
    Posts:
    23
    Hello,

    Great asset, adds so much to my game.
    I have a game where a creature smashes through the environment. I would like the damage limited to it, not the player running into walls etc.
    I am wondering if it is possible to limit collision destruction to specific objects. Possible through layers or tags.

    Thanks.
     
  25. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Here is the reply I sent you through e-mail, just in case somebody has the same issue:

    I would set the "Min Impact Mass" to a value that is higher than the player, but lower than the creature's mass. This would prevent the player from destroying the scenario, but the creature would be able to destroy it.
     
  26. popawheelie

    popawheelie

    Joined:
    May 27, 2013
    Posts:
    23
    Ill give that a shot. Thanks
     
  27. fredr92

    fredr92

    Joined:
    Jul 8, 2013
    Posts:
    292
    Hi im getting these errors


    createHull: convex hull computation failed!
    UnityEngine.Transform:set_localScale(Vector3)
    FracturedChunk:Awake() (at Assets/Ultimate Game Tools/Fracturing/Scripts/FracturedChunk.cs:73)


    createHull: convex hull computation failed!
    UnityEngine.Transform:set_localRotation(Quaternion)
    FracturedChunk:Awake() (at Assets/Ultimate Game Tools/Fracturing/Scripts/FracturedChunk.cs:72)


    createHull: convex hull computation failed!
    UnityEngine.Transform:set_localPosition(Vector3)
    FracturedChunk:Awake() (at Assets/Ultimate Game Tools/Fracturing/Scripts/FracturedChunk.cs:68)

    Just some annoying errors im getting in the console, but everything is working, any idea what i can do too get rid off the errors?
     
  28. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,912
    Would this work well for tree cutting? Have the simpler tree model enabled until you get close, then SetActive the chunked version?

    And can we instantiate pre-fractured objects from prefabs?
     
    Last edited: Jun 17, 2014
  29. red2blue

    red2blue

    Joined:
    Feb 26, 2013
    Posts:
    200
    Hi, I want to buy the asset, but I have some questions.

    1. How is the destruction triggered? I think it is by contact and maybe ray? What is about explosionForce? Asking because I think about a game fireing with a canon on some kind of structure.

    2. Is it possible to turn destruction on and of via script? Say, that after an event happend, I can turn on the destrubcability of a structure?

    Thanks a lot.

    Cheers!
     
  30. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    Hi!

    One little question. What if i don't want to destroy a wall with a direct hit. Lets say that a grenade explodes near the wall and the damage radius affects the wall. Would be possible to make the chunks affected to fly in the correct force direction?

    Now i have this made by hand, but a chunk of the wall can stay flaying in the air if all the chunks around it have already fall.



    Cheers!
     
  31. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi Fredr92,

    From the FAQ (http://www.ultimategametools.com/products/fracturing/faq):

    One or more small/planar chunks have been created and Unity isn't able to create a collider for them. You probably won't notice anything but if you want to get rid of this message you can try to increase your Min Collider Volume parameter so that the small chunks are approximated with a box collider. You will need to press Compute Colliders each time you change the Min Collider Volume value.

     
  32. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi Stardog,

    If you haven't fractured anything yet, then only one single object is drawn (and not all chunks). Also objects are initially kinematic so no physics are computed, I guess you wouldn't need to have the 2 objects version.
    As for tree cutting, it could work but I'm not sure if it would look very realistic :)

     
  33. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Do you mean you want the chunk remaining in the corner also to fall? I think it may be the explosion radius is too small, try setting it to a slightly higher value...

     
  34. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    No, these chunks are supossed not to fall. I don't have your asset. What you see in the video is "hand made". I'm asking if your asset can reproduce the relative force of a distant( not a direct hit) explosion. I check if any chunk in a certain radius and then set kinematic to false and apply the right force. Does your system work that way? I'm interested in yours because the remaining chunks can fall if they are not connected to other chunks or pillars, right?

    Thanks.
     
  35. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Yes, that is exactly how it works. If you want to do it through scripting, you can check here:
    http://www.ultimategametools.com/products/fracturing/scripting
    that you can notify a fracturable object of an explosion and specify its radius, force etc. What it does internally is indeed set all affected chunks to kinematic=false and apply the correct force. Also, as you mentioned, if there are remaining chunks that aren't connected to other chunks or the floor, they also fall.

     
    Danirey likes this.
  36. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    Thanks for the answer! :)

    I think i'll buy it. I liked to do it by myself but there are some fearures that will be a pain for me.

    Thank you.
     
  37. red2blue

    red2blue

    Joined:
    Feb 26, 2013
    Posts:
    200

    Hi UGTools,

    could you please answere my questions. That would be nice.

    Thanks!
     
  38. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi red2blue,

    Sorry I missed your post! :)
    It can be triggered by different events, each of them can be enabled/disabled at will:
    • A dynamic object (with rigidbody+collider) collides against the fracturable object and breaks it.
    • Using an included explosion source component that you can assign to a game object.
    • Through scripting using various methods:
      • Explode(), which can explode partially/completely with various parameters.
      • Collapse(), which collapses the object into chunks
      • Impact(), which enables fracturing due to missile/object impacts

    You have more information here:
    http://www.ultimategametools.com/products/fracturing/help
    and here:
    http://www.ultimategametools.com/products/fracturing/scripting

    Hope that helps!

     
    Last edited: Jun 18, 2014
    red2blue likes this.
  39. red2blue

    red2blue

    Joined:
    Feb 26, 2013
    Posts:
    200
    Hi, I have a question. I build up a very easy setup. I have a wall and a cannon and want to shot it into peaces. So far the theory. The wall has the following setup:

    upload_2014-6-20_20-7-31.png

    The Cannon has the following script:

    Code (csharp):
    1.  
    2. if(Input.GetKeyDown(KeyCode.Space)){
    3.        Rigidbody actualBullet;
    4.        actualBullet = Instantiate(bullet, muzzle2.transform.position, muzzle2.transform.rotation) as Rigidbody;
    5.        actualBullet.AddForce((muzzle2.transform.position - muzzle1.transform.position) * power);
    6.        audio.PlayOneShot(fireSound, 1f);
    7.        Debug.Log("Transform Vector Canon: " + ((muzzle3.transform.position - muzzle1.transform.position) * power));
    8. }
    9.  
    Muzzle1 and 3 are Empty GameObjects to calculate the aiming Vector. Muzzle2 is for positioning the bullet.

    The Problem is the following. If I fire a bullet:

    upload_2014-6-20_20-14-26.png

    it goes through the wall and ignores the collider. Sometime the chunks on the edges get effected, but the inner chunks are not. The speed of the bullet (Rigidbody.velocity. magnitude) is about 80. I thought, that maybe the speed is to high for the colliders, but if I shoot the same Prefab Bullet not from the cannon, but from my static camera to the wall the wall breaks correct down (speed could be up to 400):

    Code (csharp):
    1.  
    2. if(Input.GetMouseButtonDown(0)) {
    3.        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    4.        RaycastHit rayHit;
    5.        if(Physics.Raycast(ray, out rayHit));
    6.        Debug.Log("Mouse hit: " + rayHit.point);
    7.        //cube.rigidbody.AddExplosionForce(explosionForce, hit.transform.position, explosionRadius);
    8.        Rigidbody actualBullet;
    9.        explosionPos = rayHit.point;
    10.        actualBullet = Instantiate(bullet, Camera.main.transform.position, Camera.main.transform.rotation) as Rigidbody;
    11.        actualBullet.AddForce((explosionPos - Camera.main.transform.position) * throwPower);
    12.        Debug.Log ("Forward Transform: " + (explosionPos - Camera.main.transform.position));
    13. }
    14.  

    I have no Idea what is the difference. I think I can not use a Ray, because the cannon should use a ballistic curve. Does anybody experienced something like this? Maybe I can build up a WebPlayer where you can have a better Idea.


    The second question is about
    void Impact(Vector3 v3Position, float fExplosionForce, float fRadius, bool bAlsoImpactFreeChunks)

    How do I use this code / script. Do I use it on the Fractured Object within:

    Code (csharp):
    1.  
    2. void OnChunkNotification(FracturedChunk.CollisionInfo info)
    3. {
    4. }
    5.  
    Would then Vector3 v3Position be the position of the collition?

    Thanks a lot and sorry for the long post!
     
    Last edited: Jun 20, 2014
  40. TarlSS

    TarlSS

    Joined:
    Apr 26, 2014
    Posts:
    21
    Does this work for Physics2d applications at all?
     
  41. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    No, it doesn't. It works only with 3D primitives.

     
  42. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi red2blue,

    Sorry for the late reply, with the tool being currently on sale I have had tons of mails to answer :)
    I would definitely not use physics to compute bullet impacts. The method you specified (chunk.Impact()) should be used instead.
    When you fire something, you can use FracturedChunk.ChunkRaycast() to know if it hit a chunk. You know if it hit a fracturable chunk because it would not return null, it would return a FracturedChunk object instead. So:

    Code (csharp):
    1.  
    2. RaycastHit hitInfo;
    3. FracturedChunk chunk = FracturedChunk.ChunkRaycast(origin, direction, out hitInfo);
    4.  
    5. if(chunk != null)
    6. {
    7.    chunk.Impact(hitInfo.point, ExplosionForce, ExplosionRadius, false);
    8. }
    9.  
    play with the ExplosionForce and ExplosionRadius parameters to obtain different effects. Also the last parameter tells if the impact should affect already broken chunks.

    On the fracturing panel, you can set additional parameters on the Events section, under "When Impact() is called through scripting". There you can set the sound to play, particles to instance and so on...

     
    red2blue likes this.
  43. cmart

    cmart

    Joined:
    Jul 10, 2012
    Posts:
    121
    Hello,
    this looks like a great tool. Can you use this with skinned meshes? Like say you have an enemy, and when you destroy them, instead of instantiating a ragdoll, you "shatter" the skinned mesh?

    thanks
     
  44. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi cmart,

    Currently it is intended for static meshes only, so there is no skinned mesh support. What you need is a gameobject with a MeshFilter component that will be used as input for the fracturing algorithm.

     
  45. JohnyK

    JohnyK

    Joined:
    Jun 13, 2014
    Posts:
    13
    Hello!

    I am interested in buying this asset but I would like to know 2 things:

    a) Is there a way to inform me about the destruction percentage (e.x. a building is 75% down)

    b) Do different RigidBodies - Colliders cause a different amount of damage to my fractured object? If a small tennis ball hits a wall made of bricks does the wall collapses? Are there properties to determine such a realistic behaviour?

    Kind regards,
    John.
     
  46. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi JohnyK,

    a) Yes, you can use detach notifications to know exactly how many chunks have been detached and how many still remain.

    b) Yes, if you use rigidbodies then the volume and mass will determine the behaviour. If you use scripted impacts (for example for missiles, weapons or explosions) you can change the behaviour using a radius and an intensity (force) parameter.

     
  47. red2blue

    red2blue

    Joined:
    Feb 26, 2013
    Posts:
    200
    Hi UGTools,

    thanks for the explanation. I will give it a try. I would also like to take look at your Page, but it seems, that your page is down at the moment.


    Btw. Is the tool still under construction, or is it feature complete? I read at your page, that you want to do some optimization and so?


    €edit: Got everything working fine. Did the Impact on the OncollisionEnter() and now it works like charme.

    Cheers!
     
    Last edited: Jun 23, 2014
  48. red2blue

    red2blue

    Joined:
    Feb 26, 2013
    Posts:
    200
    Just have another question. Is it possible to set a drag for the chucks which are created? I don't want to edit every chuck and didn't found anything.

    Thanks for the cool asset!
    Cheers!
     
  49. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    The chunk notification script method should be added to the gameobject you specified in the fracturing panel slot.
    Regarding the chunks, I would do this in the chunk notification method as well, it should be one additional line of code :)

    Code (csharp):
    1.  
    2. chunk.rigidbody.drag = ...
    3.  
     
  50. MLow

    MLow

    Joined:
    Mar 2, 2011
    Posts:
    35
    Hi, just purchased. Very awesome.

    Quick question regarding the progress on "Big chunks". Any update on this feature? Where once the chunks are disconnected from support they do not all disconnect. I think it would be very useful to many situations. I have seen the feature requested in my reading of this thread, and see it is a "to-do" item. Just curious if we have any update as to if this is being worked on, or if it is something you haven't started yet. I'm curious as to how difficult it would be. Or if there is anything you can think of that could be done to fake it.

    Off the top of my head. Maybe an event when a chunk is no longer supported, and if that chunk is still connected to another chunk, create an array of chunks that are connected but not supported and duplicate the original "fractured object" moving the array of chunks as children to this duplicate object.

    I'm sure that's a pretty poor implementation but maybe it could lead somewhere. I do not know if it would be possible to add a rigidbody to give this new fractured object the ability to fall...

    Unfortunately this is the #1 feature I had purchased the extension for thinking it could do. Purchased it despite not researching if this was specifically implemented, mostly due to the sale. I do not regret the purchase however, as at the very least I am hopeful if not you someone will figure out a way to do this. If not I will have a go at it. :)


    EDIT:
    Come to think of it, for my application and probably most. Having the ability to just break off a chunk of something is what's needed. No need to have it able to further fracture. What I am saying is once the group of chunks is no longer supported, simply parent them to a gameobject with a rigidbody. The rigidbody mass can be gotten from the chunks added together. This new object falls and no further fracturing is needed.
     
    Last edited: Jun 24, 2014