Search Unity

Ultimate Fracturing Destruction editor extension for Unity 3D

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

  1. UGTools

    UGTools

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

    The original mesh is shown before the first contact. How many chunks are there being generated when you run it?
    Because one of those floors has 600 chunks, and 600x16 rigidbodies is a lot of rigidbodies :)

     
  2. blake_seow

    blake_seow

    Joined:
    Aug 3, 2012
    Posts:
    15
    Thanx for your reply!
    Yeah, I checked it's 600 chunks .....I think I was too greedy, wanna have the whole city build with a lot chunks :p
     
  3. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi guys!

    We are running a contest on our Facebook page where you can win one of our licenses (Fracturing & Destruction, Rope Editor or Concave Collider). Check it out!

    https://www.facebook.com/ultimategametools
     
  4. micuccio

    micuccio

    Joined:
    Jan 26, 2014
    Posts:
    143
    hi! wonderful tool,I just have a question :

    is possible to slice a Gameobject along a plane? I mean a plane that I can define.

    thanks in advance
     
  5. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Not directly using the tool, but you could do it with scripting if you want to get your hands dirty :)
     
  6. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Any update on the playmaker actions?
    also, can anyone suggest a way to use this on asteroids impacting the ground?
    I would love to use standard animation and just set a start and end keyframe, smashing the object when it collides with a collision. Right now I cant seem to get them to detach when its an animated object.
    Thanks!
     
  7. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Yes, I'm currently working on the PlayMaker actions after the last update.
    Regarding your second question, can you send me an example scene? I think it has to do with kinematic objects not triggering ontriggerenter/oncollisionenter calls
     
  8. seansteezy

    seansteezy

    Joined:
    Nov 28, 2013
    Posts:
    122
    Hey there! I feel like I've written this before, so sorry if this is a repeat... I forgot where I sent it!

    I wanted to use this on a skinned mesh character, is that possible? When I try it says there is no mesh, b/c it's a skinned mesh I guess it's specific. I'm not sure, but I think the ragdoll is the same, skinned mesh. I'm using the Toon Character Pack from Unluck, and trying to get my little zombie dudes to blow up when they die with your tool. It would be great to get it working but I figured I would see if you can point me in the right direction.

    Thanks!

    -ss
     
  9. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    Hi,

    Does the latest Asset Store have the mesh fix you sent me by email?

    Cheers

    Nalin
     
  10. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    It was something wrong with my setup, working now. Thanks! killer tools

    Request- Fade off and or shrink the small chunks when their lives are up. Maybe as an option if people worry about supporting pieces dissapearing, but there for those who don't.
    Thanks!
     
    Last edited: May 28, 2015
  11. UGTools

    UGTools

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

    I'm afraid we don't support skinned meshes. Meshes are fractured at edit-time, and skinned meshes change continuously at runtime so right no it is not an option :(

     
  12. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    No, I'm waiting a couple of days more to add the PlayMaker actions as well in this update.

     
  13. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Noted! thanks :)
    I think the next update regarding that issue will make the meshes static so that they will benefit from faster rendering, no physics computations and better batching.

     
  14. BigBlaster

    BigBlaster

    Joined:
    Apr 25, 2015
    Posts:
    1
    Hi, I would like to create objects which can falling down by gravity and breaks apart only when hits the ground or other static object. Is it possible with your asset? If yes, how can I do this?
    Thanks!
     
  15. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @ UGTools - can I use this Asset to do things like decapitation etc in say a sword fighting game ie. loss of limbs (!sorry) etc?
     
  16. UGTools

    UGTools

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

    No, I'm afraid skinnedmeshes are not supported at the moment.
     
  17. Cool_Flow

    Cool_Flow

    Joined:
    Apr 14, 2013
    Posts:
    21
    I just installed your asset to Unity v5.1.0f3 and this is a warning I got in the console.

    Assets/Ultimate Game Tools/Fracturing/Scripts/FracturedObject.cs(158,57): warning CS0618: `UnityEngine.Material.Material(string)' is obsolete: `Creating materials from shader source string will be removed in the future. Use Shader assets instead.'

    Just to give you a heads up. :)
     
  18. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Thanks for the heads up! I will take a look at it
     
  19. VectorSigma

    VectorSigma

    Joined:
    Dec 22, 2014
    Posts:
    3
    Hi there,

    Just bought your tool yesterday.

    I noticed that on some meshes the number of chunks can't be set to anything less than 23. I don't seem to be getting any errors either. Any idea what I might be doing/setting wrong? Using Unity 5.1.0F3.

    Screen Shot 2015-06-24 at 2.21.30 AM.png


    Screen Shot 2015-06-24 at 2.44.27 AM.png
     
  20. abhijeet1001

    abhijeet1001

    Joined:
    Jan 6, 2015
    Posts:
    65
    cant we break skinned meshes ? which were imported as whole ? and break them directly using this package inside unity ?
     
  21. catjack

    catjack

    Joined:
    Sep 30, 2014
    Posts:
    12
    how we can make it with UFPS?What we need to add in the script?Thanks!!!!
     
  22. catjack

    catjack

    Joined:
    Sep 30, 2014
    Posts:
    12
    Hello.I followed you and I need your help please.I am working with UFPS and the objects are not destroyed.Can you please help me with the code?I tried several times and still no succes.
    Please let me know.
    Thank you - Jack
     
  23. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi VectorSigma!

    You have "Generate Mesh Islands" checked. This checks for isolated meshes inside your structure and separates them into different chunks. If you leave it unchecked you should get your specified amount of chunks :)

     
  24. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    You only can break static meshes using the MeshFilter component, instead of the SkinnedMeshRenderer component.
    This is because meshes are prefractured at edit time, and you can't know the mesh shape of a skinnedmeshrenderer until that very moment at runtime where it needs to explode.

     
  25. UGTools

    UGTools

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

    As far as I know, when something is hit by UFPS, if the GameObject that gets hit has a script with a Damage() method, it gets called.
    It would be nice if you could confirm me this. If so, add a script with the following method to all chunks:

    Code (csharp):
    1.  
    2. void Damage()
    3. {
    4.   GetComponent<FracturedChunk>().Impact(transform.position, ExplosionForce, Radius, true);
    5. }
    6.  
    The last parameter tells if free chunks should also be affected by the hit.

    Tell me if it works!
     
  26. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    Hello, I am using Unity 5.1.1

    Thanks very much for taking the time to read all this post as at first was small, but now it has grown much

    Hello, I am now beginning to use your awesome and amazing asset for destroying and fracturing things inside Unit

    1 - Please, can you be so kind to tell me how you have done yourself with the Rayfire wall from the video?

    I mean if you remember how many fracture objects you have put, and what kind of fracture option you have used?

    I understand and think that is not ONLY the amount of fragmented objects, as also the amount of polygons each of the fragmented objects has

    2 - What is the real difference, benefit, advantages or disadvantages between the both options available:


    2a - Internal - Fracturing a 3D model with the own included internal fracturing tool in Fracturing & Destruction

    2b - External - Fracturing a 3D model in an external 3D software and then import into Unity this pre-fractured 3D object ?

    I mean why would you want to fracture the 3D model externally if you can do it inside UNity with your tool. One thing I know from Rayfire is that it includes LOTS of different ways of fracturing in multiple ways, and it may be faster to do it. But then you may find that Unity will not let you import it because of the 655535 vertex limit.

    Sorry that I still do not know what is the real difference between doing the fracture with your tool, or do it with an external 3D software as you have done very well with Rayfire, I mean that if it is better to do it externally from the perfomance point of view, or may be a technical reason.

    3 - It works RIGHT with fractured wall made inside Unity with with the own included internal fracturing tool in Fracturing & Destruction using Voronoi

    I have loaded the 4th sample scene, made a wall similar to the one on the demo video, and then I have put this as source object in the Fractured object script, then in Fracturing & Interior Material, I choose Voronoi, and in the Cells X,Y,Z I put a value of 10 in each one and then add the internal material and click on "Compute chunks" and then it can be possible to destroy it very well and it works right with a good effect.

    At first was bad, because the total mass was very low, so I have put 1000 and works much better

    I used Voronoi because with the BSP that is faster but the result is weird and not what I expected, is too linear and rectangular.

    4 - How to make it that does not explode all at once and make it like in the video tutorial that is broken in parts?

    As told on point 3 it works right, but when you fire at it, it explodes everything at once, and not in the way you are showing in the video, I think and suppose that this is because you may have added support planes or there may be an option to connect the chunks in some way.

    I have put Start Static checked as the wall it is not attached to anything else

    I am using Chunk Interconnection, please see attached below at the end a screenshot with the values used in the Inspector Fractured Object

    5 - When trying to make a prefab from this newly created fractured object to be used in another scene it does not work as expected

    I know that when you make a prefab from drag and drop from Hierarchy to Project it makes a prefab keeping all the values and objects inside.

    Well I have tried to drag and drop to Project the newly created fractured object and it will only make a prefab with only the Fractured Object script and the values I have configured, BUT the source object and the computed chunks are missing when you try to put this prefab into another different scene, although it WORKS correctly and right IF you want to use this same prefab in the SAME scene where the source object and fractured objects are kept.

    Maybe you must fracture the object ( Compute chunks) in the final scene already where you are going to use it, and not make a prefab of it to be used in another different scene.

    6 - When combining the fragmented objects from an external pre-fragmented imported wall object gives me a 65535 limit error

    I know that the 65535 error limit is NOT from your tool and is from Unity itself that uses 16 bit index for importing 3D models, so it is not your fault

    I have made a fractured Rectangle box (like a wall in the same way as in the video tutorial below) in Rayfire inside 3Ds Max with 1587 fragmented objects
    I imported it into Unity and then followed exactly what is told in this great and well done video tutorial

    Importing externally fractured scenes to Unity 3D using Fracturing and Destruction tool


    The problem came when I arrived to the part when I have to click on the button "Combine" (after clicking on "Build list from root node"), Unity gives me an error telling me that it can not complete the task because when I try to combine all the 1587 into 1 as required, there is more than 65535 vertices as shown on the screenshot attached

    Then I have made a second one with 1000 fragmented objects and it gives the same error that will not let you combine into 1

    After I made a new third fractured object with ONLY 40 fragmented object in fear that it could give me again the same error, but this time it did work right and when combining did not get any error, BUT the problem is that the fracturing is too rough as there is too little fragmented objects, what I want is to have something similar to what is seen at the end of the video tutorial above,

    As said, How was done that fragmented panel of the Video tutorial in Rayfire?

    I agree that maybe it could have TOO MUCH polygons, but

    7 - How do you know how much polygons will it have once it is combined?

    8 - How can you know that when combining it will not reach the 65535 vertices limit?

    9 - Is there some tool or asset in Unity that can tell you how much vertices or polygons an 3d object has?


    I have just seen that there is one NEW asset that may be useful for this, but of course this will ONLY tell you individual polygon count and not a group of 3D objects.

    Polygon Count
    https://www.assetstore.unity3d.com/en/#!/content/38659

    APART FROM THIS

    Also in the error message is this Warning that maybe would be useful for a future update that may be needed

    Assets/Ultimate Game Tools/Fracturing/Scripts/FracturedObject.cs(158,57): warning CS0618: `UnityEngine.Material.Material(string)' is obsolete: `Creating materials from shader source string will be removed in the future. Use Shader assets instead.'


    Thanks very much for your possible help and for making this wonderful and great tool that is very useful and well done
     

    Attached Files:

    Last edited: Jun 29, 2015
  27. catjack

    catjack

    Joined:
    Sep 30, 2014
    Posts:
    12
    Thank you for you super fast reply!
    I found yesterday the solution, the simple and classic solution: I added to bullet a sphere with rigid body and mass, working super great!
     
  28. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    Apart from the post from me above of this one, I am Sorry that I forgot to give a big thanks for all these very good, detailed and useful answers to my list of questions, much appreciated and like much your tool that I own and surely recommend it

    Please, is there any news about this topic shown here below?

    Maybe would be good to have some kind of pooling for the fragmented objects?

    4 - ARE THE GENERATED BROKEN PARTS MERGED TO AVOID DRAW CALLS?

    This is also one of the features we are working on. Broken+resting pieces will be converted to static so that no physics are computed and they can be merged ins single drawcalls.

    Right now physics will be computed until they go to sleep, but if they get hit again they will wake up. Also, they can benefit from dynamic object batching to reduce drawcalls but due to limitations (number of vertices, shadows, vertex attributes) this isn't always the case.

     
    Last edited: Jun 29, 2015
  29. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
  30. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    I have a problem that I have been able to finally make a fractured wall using the Voronoi of Fracturing and destruction, and now it work right and explodes correctly when using the weapon included in demo scene 4, BUT what I do not know is HOW to use my OWN weapons to be able to destroy what I have fragmented with the fracturing and destruction tool

    I am trying to use the weapons included in the Sci Fi Effects asset https://www.assetstore.unity3d.com/en/#!/content/20416

    Maybe I am wrong thinking that there is needed some of the scripts included in the demo scene 4 to destroy the objects, and so I am confusing things, and it should be done in the Unity usual way for collision, without any of the fracturing and destruction tools scripts?

    Please could be so kind to explain it a little more?

    Thanks very much for any help
     
  31. VectorSigma

    VectorSigma

    Joined:
    Dec 22, 2014
    Posts:
    3
    It worked! Thanks for the help.
     
  32. CrypticError

    CrypticError

    Joined:
    Jul 11, 2015
    Posts:
    2
    How can I "Fill" my destructed object. When the object is fractured, each part is almost 2d...
     
  33. seansteezy

    seansteezy

    Joined:
    Nov 28, 2013
    Posts:
    122
    Hey there!

    I was wondering if anyone has tested this with Quantom Theories' Low Poly Woodland toolkit? I am getting issues when I combine a mesh prefab house and I lose my texture on the exterior of the generated chunks...

    Any idea what this could be?
     
  34. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Hi, I'm trying to create a destructible object that should be destroyed by a car.
    It works, but the problem is that the chunks fly away so fast that I can't even see them moving. They just disappear from the screen. I tried playing with the Total Mass and Exit Force with no luck.
    I also don't understand the Exit Force value. What it means that the chunk will have that value "applied" to it? I tried with 0, 0.001, 1000 and I didn't see any difference.
    My car has a mass of 1000.
    Thanks
     
  35. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    Does mass in Unity have to be within a range of 0.1-10? I may be misunderstanding things, but if so, then when you go outside of that range you can expect instability.

    http://docs.unity3d.com/ScriptReference/Rigidbody-mass.html
     
  36. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Yes this is what Unity states, but the Edy's plugin for the car physics use a value in thousands. Also the Colliding Sphere sample of Ultimate Fracturing use a mass of 100 for the ball that falls.
    So it's hard to say what is correct. I could try to change the car plugin to use a lower mass to see if it helps, but would be useful to hear an opinion from @UGTools.
     
  37. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Ok I scaled all the values and the car now has a mass of 1, and still the Chunks disappear instantaneously.
     
    Last edited: Jul 31, 2015
  38. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    Sorry, man. That was all I had. I'll be curious to see what the solution is here.
     
  39. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Ok, it's my fault. For some reason also if I add at runtime a simple box with a rigidbody it starts to fly away in a specific direction. The car has a large trigger that I use to detect if some objects are near enough to start doing some actions.
    I don't know why this is applying some forces to any rigidbody, but I'll investigate more.

    Anyway I'd like to understand better the Exit Force property. Does it override the impact force with a fixed value force?
     
  40. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    I got it working correctly and the Exit Force seems to be a factor of the impact force applied.
    I still have one major problem. The car stops completely when it hit the obstacle, doesn't matter the Total Mass value.
    So if I want to break a glass or a concrete wall it behaves in the same way.
    This seems caused by the fact that the chunks are set as kinematic objects before the impact.
    Do you have any suggestions?
    Thanks
     
    hopeful likes this.
  41. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    Hi all.

    I want to give a suggest for the next updates if possible…. Since Unity5 has new audio mixing options(like duking) It would be great if you add a new variable to choose what mixer to use with the collision sounds and stuff like that. In my project i have all the SFX playing through a bus in the mixer, and i miss that option a little in my project.

    By the way, any advance in the chunk performance to do list?

    Cheers!
     
  42. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Any answers from @UGTools ... It had to resolve it by myself. In case someone is interested I'll explain how to do it.
     
  43. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    Well, I wouldn't want you to have spend a lot of time on it, but it would probably be good to in some wise get it recorded. No doubt others will be running into the same sort of thing.
     
  44. UGTools

    UGTools

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

    I will take a look at the new audio mixing options in Unity 5 then :)
    Regarding advances in F&D, we are releasing this week or the next one 3 new plugins which have taken all our time. Hopefully after that I can come back and work in some improvements!

     
    Danirey likes this.
  45. UGTools

    UGTools

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

    Sorry for the ultra delayed answer. I took some days off for vacances and just came back. Hopefully I can still help you with things :)
    The exit force parameter is applied when a rigidbody impacts the fracturable object with enough force/speed to detach chunks. Each chunk will have an rigidbody.AddExplosionForce() call applied:
    http://docs.unity3d.com/ScriptReference/Rigidbody.AddExplosionForce.html
    where ExitForce is mapped to the first parameter of that call.

    The colliders moving at the speed of light may have to do with some chunk colliders overlapping others? Is there something I can change to improve your scenario?

    Best regards

     
  46. UGTools

    UGTools

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

    I'm not sure if I'm allowed to have access to that model but I surely would like to test it out to see what may happen

     
  47. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
  48. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    That's great news! Thanks!
     
  49. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    1. Thank you for the explanation on the Exit Force. For what I understand the explosion is not affected by the mass/speed of the impacting body and by the mass of chunks. But probably it should, to have a more realistic behaviour. I saw that I have to manually tune it every time I change the Total Mass.

    2. I confirm that it was an overlapping huge collider causing that fast movement.

    3. My last question was about the dynamic of the colliding object. The main problem is that the chunks are flagged as Kinematic object. It means that the car completely lose velocity when it hit the destructible object. This is not correct if the 2 masses are different.
    A partial solution was to intercept the collision event on the car and set the velocity and angular velocity of the car to the values of the previous frame, overriding the values calculate by Unity. Then I reapply the collision forces on the car based on the mass of the fracturable object.
    It works, but not always. I suppose that it could depend on the internal order of collision events, or that not all the chunks are activated at same time, so the car sometime stops anyway. I really need to resolve this point. If you have any suggestion or solution would be great.

    Thanks
     
    Last edited: Aug 5, 2015
    hopeful likes this.
  50. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Solution:
    1. Add a collider to the main parent object, and a non kinematic rigidbody, also not affected by gravity.
    2. On awake (and on respawn in case of using a pool) disable all the colliders of the chunks, apply the mass of the parent rigidbody to the Total Mass and put the parent rigidbody to sleep.
    3. On collision with the parent rigidbody the car will behave properly based on the masses. Disable the parent collider. Enable the chunks colliders, and call the ExplodeChunks method using the collision point, the mass of the car and relativeVelocity to calculate the Force. For optimization and gameplay reasons I also disable the chunks colliders after 3 seconds.
    It works very well in every test, from 20 to 2000 of mass.
     
    UGTools and hopeful like this.