Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Released] DestroyIt - Cinematic Destruction System

Discussion in 'Assets and Asset Store' started by DeadlyAccurate, Jun 14, 2014.

  1. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    @zangad - that's good news. I'll pick it up today and wait for the update :)
     
    DeadlyAccurate likes this.
  2. RedEyeFox

    RedEyeFox

    Joined:
    Jan 8, 2013
    Posts:
    27
    I can't wait for the update... btw i pick it up bifore 20min :p ,GOOD JOB...ModelShark!!!
     
    DeadlyAccurate likes this.
  3. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Hi, do you have an eta on Unity 5 update?
     
  4. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    186
    Nearly there! We should be ready to submit it early next week.
     
    julianr likes this.
  5. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Great! I should be ready by then also. Looking forward to using it.
     
  6. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    186
    We'll be submitting the DestroyIt 1.3 update today (or tomorrow at the latest). Here are the patch notes:


    1.3 (Mar 2015)


    THIS IS A MAJOR UPDATE - PLEASE CREATE A BACKUP COPY OF YOUR PROJECT IF YOU ARE UPGRADING FROM A PREVIOUS VERSION OF DESTROYIT.

    The best way to upgrade is to delete the entire "DestroyIt - Core" folder and re-import the new version of DestroyIt. Be sure to copy out any materials you may have saved to the Material_Preload folder. Also, click "Save To File" on the Object Pool, so you can quickly reload any object pool entries you've added.

    Unity 5 Fixes/Enhancements
    • Support added for progressive damage using the Unity 5 physically-based rendering Standard shaders. See documentation for instructions on how to use it.
    • Removed use of the ForceCollisions script, since fast-moving rigidbodies (like the cannonball) now correctly register collisions using Continuous collision detection on the rigidbody.
    • Destructible objects will automatically transfer any Reflection Probe Anchor to all mesh renderers on their destroyed prefabs.
    • The PoweredLight script now includes an optional "EmissiveOff" material, so you can have it turn off emission when the light goes out. This is illustrated in Scenario #10 "Power Sources" in the demo scene. When the light fixture becomes unpowered, the lampshade's emission is turned off for added realism.
    • The legacy DestroyIt Progressive Damage shaders were updated so they no longer double light input values.
    General Fixes/Enhancements
    • Support for melee weapons added. Fireman's Axe was added to the demo scenes to help get you started adding your own melee weapons.
    • "DestroyItDebris" layer is now automatically created on project startup if it doesn't already exist.
    • PoolAfter script - Added option to reset an object back to its original prefab state prior to re-pooling it. Useful for re-pooling destroyed objects.
    • A few particle effects were fixed: BulletStrikeWood and BulletStrikeConcrete were using the "stuffing" sprites by mistake. Color gradients were fixed on the BulletStrikeStuffing particle effect so now there's a mixture of white and black bits.
    • Added a collision.contacts safety check to both HitEffect and DestructibleParent scripts.
    • Removed many user-supplied fields from the InputManager script and made it smarter about locating weapon positions on the First Person Controller.
    • On the Destructible script, under "Children to Un-Parent when Destroyed", if you set a child to un-parent and then later move that child from under the destructible object, the reference to that object will be removed and it won't try to unparent it.
    • Now if you add a duplicate item to the object pool, it will remove the duplicate automatically and log a message, telling you that the item already exists and what item number it is.
    • Singleton scripts (DestructionManager, ObjectPool, MaterialPreloader, etc) were upgraded from lazy to standard, so now they will instantiate themselves from the scene whenever they are first accessed. This means you no longer need to mess with Script Execution Order for DestroyIt.
    • Clinging debris is now always parented under the object it clings to. This creates a more solid joint and is better for performance than adding and managing hinge joints for every piece of clinging debris.
    • New "Sink into Ground" option on Destructible script. If checked, the object will sink into the ground instead of being destroyed into particles/debris.
    Demo Scenes Fixes/Enhancements
    • Demo scenes are now setup to use Linear color space for more realistic lighting, since it's available to everyone (it was a pro feature in Unity 4). To enable, go to Edit => Project Settings => Player and change Color Space to Linear.
    • Deprecated "lockCursor" code was changed to use new lockState enum in the demo scenes.
    • Hinge Joint break/torque strengths are very different in Unity 5, so we had to increase the strength of support points (from 23 or so to 750) to keep the wooden tower from collapsing.
    • The wooden chest (Scenario #13) was changed to WakeUp() the rigidbody on open/close so it would trigger the hinge motor to activate.
    • Gun muzzle flash and BulletStrikeMetal particle effects were adjusted (tint white level increased) because they looked dull under Linear Lighting.
    • Skybox fixed in SUV scene (textures had alpha but not marked as HDR).
    • Glass pane debris shards no longer use thicker beveled colliders to prevent them falling through the ground. Instead, they use thin colliders based on the mesh and collision detection was changed to Continuous Dynamic.
    • On the cogbox's spinning cogs, removed the extra delay in the DelayedRigidbody script, since the new PhysX version handles collisions better and doesn't send the cogs through the thin box on high-speed impact.
    • Nuke got a visual update via the tonemapping image effect on the camera. This blows white levels out and makes the scene look weird and high-contrast while the nuke is in effect.
    • Particle and flare color/alpha values had to be brightened for demo scene assets.
    Known Issues (Unity 5 Related)
    • In the demo scenes, the mouse cursor flickers in the middle of the screen on Windows machines while in the editor ( http://forum.unity3d.com/threads/cursor-lockstate-troubles.278221 ). This only happens in the editor, not once you've built your game.
    • When shooting the springy ground targets (scenarios #16 and #17) with the cannonball, the impact seems to be so great sometimes that it "pulls" the target up from the ground a bit and there's a pause/freeze before it repositions the target and lets the physics continue. I think this is a hinge joint collision related issue.
    • The FadeOut script doesn't work for Unity 5 standard shaders, and we haven't been able to create a script that's as simple to use for the new shaders because the way they strip out any feature that isn't used at runtime. This means in order to get it to work with the standard shader, you would have to know to create a variant with Fade render mode and add that to your list of preloaded shader variants and also add the script to your destroyed objects, which is a bit much. We're waiting for a solution or for a ShaderForge version of the standard shaders, so we can make our own fading shader, like we did in Unity 4.
     
    julianr likes this.
  7. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Can't wait to try it out :) thanks for getting this update out.
     
  8. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    355
    Hey everyone!
    Here's some extra info about a few new features in our Unity 5 update.

    New "Minimal Setup" Option
    This option is located in the Window\DestroyIt menu. It provides you with the bare-bones essentials for setting up DestroyIt with existing or new scenes. So now, instead of picking through the demo scenes in order to find what you need to port over, you can simply choose Minimal Setup and it'll drop two pre-configured game objects into your scene, and you're ready to go.



    Progressive Damage for Unity 5 Standard Shaders
    In Unity 4, we created our own progressive damage shaders for DestroyIt. You would feed each material a damage mask and damage textures. Also, if you needed transparency, you would need to use our Transparent shader. If you needed reflection, you would need to use our Reflective shader, and so on.

    In Unity 5, we simplified this process by using the Secondary textures and detail mask already built into the Standard shader. This means you won't need to use any special shaders to get progressive damage, just the Standard one. This gives you MUCH more flexibility. Now if you need high reflection, you just add a reflection or metallic map. If you need transparency, you simply lower the alpha of your albedo color. If you need emission (something we didn't even cover with our previous shaders) you simply add an emission map. The drawback is that progressive damage uses the Secondary texture slots. But we feel the pros far outweigh that drawback. And besides, you could always combine the textures you were going to use in the Secondary slots to your albedo if you really needed to.

    Here's a visual of how progressive damage works with the Standard shader:



    NOTE: the Unity 5 version of DestroyIt still supports our custom progressive damage shaders, so if you're not ready to update your shaders, everything will still work fine.
     
    Last edited: Sep 18, 2017
    MIK3K and julianr like this.
  9. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    355
    Hey guys, the Unity 5-updated version of DestroyIt (v1.3) is on the asset store now. Let us know if you have any questions or issues.

    Updated web demos are also coming. We've been wrestling with the new web player, trying to get it working with Chrome. For some reason it keeps thinking it's a developer build, and the terrain in Chrome is super-glossy even though smoothness and metallic are set to zero. We're hoping to have those issues sorted out tomorrow.
     
    Last edited: Apr 1, 2015
  10. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    355
    Last edited: Sep 18, 2017
    MIK3K and julianr like this.
  11. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    This is just an awesome addition to my game. I'll make a video on it soon.
     
    zangad and DeadlyAccurate like this.
  12. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    355
    That's great! We look forward to seeing what you've created.
     
    julianr likes this.
  13. kimsama

    kimsama

    Joined:
    Jan 2, 2009
    Posts:
    166
    What platform does it run?
    There is no mention what DestroyIt supported platforms. Does it run on mobile such as iOS or Android either on PC?

    Cheers,
     
  14. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    186
    We haven't personally tested on mobile, but it'll run on all platforms that Unity supports, and I know some customers are using it on mobile. There are managers that can control the amount of particle effects, debris created and left behind, and an object pool, so you can tweak the numbers for the system you need it to run on.
     
  15. kimsama

    kimsama

    Joined:
    Jan 2, 2009
    Posts:
    166
    Thank you for the answer.

    Cheers,

    - Kim
     
  16. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    186
    Just submitted to the asset store:

    v1.31 Changelog:

    Fixed an NRE that could occur with the material preloader.
     
  17. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    thanks very much for the quoted post shown below from page 2 and sorry much for not answering before and taming so long

    Now finally I am going to test it and wonder how can I use my OWN weapons to make the destruction instead of using the weapons from the demo, I have already bought many ready made weapons from the asset store and I if they could be compatible and how to use them with Destroy It

    i have read the 14 pages of the manual, and also seen the videos and seen this forum and have not found information about using my own weapons, maybe I am missing something

    WEAPON MANAGEMENT WITH THE DESTROY IT DAMAGE MANAGER?

    inside the Destroy is of course the damage manager, but is there also a weapon manager to use your own weapons?

    I also know that there must be 2 different ways to manage these, as it not the same to use weapons that

    1 - use a 3d model projectile or bullet (the ones that shoot something toward the object to be destroyed and has a collision)

    2 - use a Weapon that is based on light effects or particle system, lime for example a laser that is only light or particle effects and so you should be used ray cast for detecting collision , and this may be the real problem

    Please do you know how can I know if the weapon I want to use may be compatible with your amazing damage manager and be able to work with these wonderful destruction effects you have created?

    I mean to be able to use for example

    Sci Fi Effects - https://www.assetstore.unity3d.com/en/#!/content/20416

    PRO Weapons FPS - https://www.assetstore.unity3d.com/en/#!/content/21871 without the FPS part

    Laser Beams - https://www.assetstore.unity3d.com/en/#!/content/18138


    Thanks very much for any help
     
    Last edited: May 14, 2015
    zangad likes this.
  18. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    355
    Hey SpaceRay,

    This question has come up before, so we thought it might be worth putting together a quick tutorial video showing how to integrate DestroyIt with a custom weapon system. Since we also own the awesome Sci-Fi Effects asset, I decided to use that one to illustrate the process.



    Here's step-by-step instructions that summarize what I'm doing in the video:

    1) Import both Sci-Fi Effects asset and DestroyIt into your project.
    2) Select Window -> DestroyIt -> Setup - Minimal. This will add all the necessary scripts for DestroyIt to your scene.
    3) (Optional) Delete DestroyIt-InputTest. You don't need this game object.
    4) Add the Destructible script to each object you want to be destructible. In this case, it's the spheres and crates.
    5) Add code to each weapon's ApplyForce() method that checks if the hit object is destructible, and if so, applies damage to it:
    Code (CSharp):
    1. // Check if the hit object is destructible.
    2. DestroyIt.Destructible destObj = hitPoint.transform.GetComponentInParent<DestroyIt.Destructible>();
    3. if (destObj != null)
    4.     destObj.ApplyDamage(10); // If the object hit is destructible, apply damage to it.
    That's it! The process is pretty much the same for any weapon system. They all either raycast (beam weapons, hitscan bullets) or create game objects that travel towards the target (rigidbody or gameobject projectiles), or do their effect some other way, such as an area of effect (rocket splash damage).

    Note: You may notice that the Seeker rocket doesn't really behave like a rocket. For example, it will only affect objects that are directly hit. That's the way the asset was created. It does a raycast and applies force to the rigidbody it hits - it doesn't do "splash" damage like the rocket in the DestroyIt demo scene. Neither way is "wrong", just different. It depends on what you need for your game.

    Note: The Flamethrower is simply a particle effect - it didn't have any hit effect I could hook into to apply damage to affected objects. You'd have to decide how you want to do flame damage and flesh it out. What I would probably do is attach a cone-shaped mesh collider to each of the gun barrels and set them to be trigger colliders. Then I'd attach some OnTriggerEnter() code to the colliders that does damage every second to anything it's touching. Of course, there would need to be some logic, because metal objects probably shouldn't take damage from a flamethrower. In the DestroyIt demo scene, the nuke has a shockwave wall that is just a big trigger collider, which applies a large amount of damage and force to anything it touches. The concept is the same for a cone-trigger-collider flamethrower.
     
    SpaceRay, MIK3K, s7 and 1 other person like this.
  19. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    WOW!!!! AWESOME !!

    You have made a video tutorial explaining how to make your own custom weapons using the great Sci Fi Effects weapons, and is really very easy and simple to use and to modify what is needed, And also you have made it on text too and explained also here very well LOVE IT MUCH!!!!!

    This is REALLY VERY helpful and useful and solves very well the big problem I had for using different weapons with your amazing, excellent and high quality destruction and damage manager that is Destroy IT.

    I have done it myself as you have suggested and it works very we'll

    Thanks very much for your GREAT help that solves very much my problem

    Wish you the best
     
    DeadlyAccurate, MIK3K and zangad like this.
  20. MIK3K

    MIK3K

    Joined:
    Sep 10, 2014
    Posts:
    144
    The asset is great, but the support and tutorials save so much time and confusion getting things working quickly and make this such a great bargain. Very grateful for that.
     
    zangad and DeadlyAccurate like this.
  21. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    What is the perfomance difference for mobile games that use simple destruction prefabs, or use prefractured (outside in a 3D software) so it could be more realistic for some things, but maybe using a prefactured one could hurt and make a more impact on perfomance versus a simple destruction prefab

    Of course that I understand and know that it will also depend on how big and complex the prefactured object may be
     
  22. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    186
    I'm not sure of any specifics. A single object being destroyed is probably negligible unless it's prefractured into hundreds of pieces. It's more about how many total rigidbodies and colliders appear in the scene at once. With DestroyIt, you can control that with the DestructionManager, so you can make sure that no more objects appear in the scene than your system can handle.

    In the top left corner of the demo scene is a "Destroyed Prefabs (last 4s)" and "Destroyed Particles (last 4s)." Those show when the scene throttles the number of objects. (If you use the nuke and destroy the scene, you'll see it hit red as it hits the limits).
     
    Last edited: May 24, 2017
  23. Hamesh81

    Hamesh81

    Joined:
    Mar 9, 2012
    Posts:
    405
    Great asset here! Just a question; with a destructible object that has several parts (eg. SUV example) how exactly would you go about handling LODs and still keeping the same level of destruction? For example; I assume that at LOD2 or LOD3 an asset will likely need to get combined into a single model for performance, but in that case how can the different parts (wheels, windows etc) still remain destructible?
     
    zangad likes this.
  24. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    355
    Hey Hamesh81,

    There are a few ways I can think of to handle long-distant destruction:

    Limit to Particle Effect via Camera Distance: For this method, don't do anything to the models themselves. Make sure on DestructionManager you've set the CameraDistanceLimit to limit destruction to particle effects out past a certain distance from the camera:



    So in the case of the SUV, if someone were to shoot the tire out and they were 100 units (usually meters) away from the camera, they would see the tire pop into a particle effect. It would look very similar to how it normally looks, except the metal wheel debris wouldn't be instantiated and left on the ground. If the SUV was moving, it would still struggle with the loss of a tire and probably swerve out of control, even at long distance.

    This method works best if you've set fallback particle effects on every destructible object (a good practice to get into), you only have a few of these types of complex destructible objects in your scene, and you're okay with things like a hood or door being destroyed into a particle effect at long distance.

    Make LOD Versions of Destructible Components: Don't combine your complex destructible objects into single objects, instead make LOD versions of each destructible component. In the SUV example, you would have LOD versions of all the destructible parts, like the tire. This LOD version would be very low polygon and would also point to a low-poly version of the destroyed prefab. When the tire is shot at distance, it would instantiate the LOD1 version of tire debris. As a player walks closer to the debris, the LOD group would switch it out with the LOD0 (high-poly) version automatically.

    This method works best if you have a lot of complex destructible objects in any given scene, and the objects are mostly composed of similar components. So for example, a racing game. Since the cars are composed of similar or identical components that only have different textures, you would get a lot of reuse out of your LOD versions.

    Combined with the DebrisManager limiting and auto-collecting the amount of debris in the scene, this method is a good compromise between looks and performance.

    Combine Complex Objects: This is probably the most performant, but also the most restrictive. You would leave your complex version of the object as LOD0 and combine it into a single fused object for LOD1. So in our racing game example, when the car goes to the far end of the track away from the camera, the LOD group switches the car from LOD0 prefab to LOD1. The wheels would be locked and no longer spin, so that would have to be handled with a looping particle effect. There would be no way to know if a single tire was damaged, because there is no single tire object at this point. After a certain amount of damage, the car would just explode into parts, assuming you had linked the LOD1 version of the car to a LOD1 destroyed prefab. It would work, and would be very performant, but probably wouldn't look all that great for a racing game where the destructible objects at distance are still interactive, and where it's very important to know how damaged the rear right tire is (for example).

    However, if most of your complex destructible objects are stationary, like a bunch of old cars in a huge junkyard, this method would work great, and allow you to have way more destruction than you could have with separate destructible car components.

    I hope that helps, let us know if you have other questions or ideas.
     
    Last edited: Sep 18, 2017
    Hamesh81 likes this.
  25. Hamesh81

    Hamesh81

    Joined:
    Mar 9, 2012
    Posts:
    405
    Thank you so much for that highly detailed answer. I have been thinking recently that what I could do is instead of enabling and disabling LOD gameobjects depending on LOD distance, I could simply enable and disable the relevant renderer components of the LODs. This way, the collision of the detailed LOD0 would still be working for all the LOD levels in the same way, however the visual model would degrade based on the different LODs. So even at LOD3 where the SUV would be an optimized combined mesh, the colliders would still absorb the same detailed collision information (windows, wheels, tyres etc), store it, and then apply it to the relevant models once their renderer was turned on again. I'm not sure if this would work?
     
    zangad likes this.
  26. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    355
    Yeah, I think that will work fine. Colliders and rigidbodies can still kill performance, though, so the method you've outlined would probably work best in a game that has many complex destructible objects (like cars) but the player does not have the ability to destroy many of them at once (like with rocket launchers, etc). If you allow large-scale destruction, you're probably still going to need to reduce the number of colliders and rigidbodies. The physics have gotten a lot better in Unity 5, but there's still a limit.

    I wanted to put your idea to the test, because I wasn't sure how DestroyIt would handle it, either. DestroyIt doesn't require a mesh renderer to be active on a destructible object, so we're good there. I first created a low-poly LOD1 model of the SUV and did a quick & ugly UV texture job:



    Then I turned off all the mesh renderers on the SUV but left everything else intact. I parented the LOD1 mesh under the SUV body so it would move and sway with the vehicle frame:



    Then I ran Unity and damaged the SUV a bit. Here's a video:



    As you can see in the video, the model looks terrible at this distance but the destruction is still accurate: tires are popped which causes the vehicle to lurch on its side, the engine takes enough damage to start smoking, glass windows are broken out, and headlights bust and wink out. Aside from the headlights going off, none of this damage is visible on the LOD1 model, but if you were to turn the LOD1 mesh off and turn the mesh renderers back on for the LOD0 model, you would see all the destruction reflected.

    So I think your idea will work perfectly! Just keep in mind the number of colliders and rigidbodies if you start having slowdowns. But if that does happen, you still have quite a few options for getting performance back up, both with the DestroyIt system and with Unity itself.
     
    Last edited: Sep 18, 2017
    DeadlyAccurate and Hamesh81 like this.
  27. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    355
    Hey everyone,

    Unity 5.1 just came out, and if you've already upgraded you may have noticed you now get an error in DestroyIt. It's not a major error or anything, Unity just changed the name of one of the variables we were using. Here's the error:

    Assets/DestroyIt - Core/Scripts/Extensions/GameObjectExtensions.cs(74,71): error CS0619: `UnityEngine.JointLimits.maxBounce' is obsolete: `minBounce and maxBounce are replaced by a single JointLimits.bounciness for both limit ends.'

    And here's the relevant Unity 5.1 release note:
    • Physics: HingeJoint MinBounce and MaxBounce are replaced by a single 'bounciness' for both limit ends. The new bounciness will be set to the largest of the old MinBounce and MaxBounce.
    We'll be submitting a hotfix to the asset store to fix this issue within a couple of days, but in the meantime if you want to fix it yourself, it's really easy:

    1) Open the DestroyIt - Core\Scripts\Extensions\GameObjectExtensions.cs file with a text editor.
    2) Scroll down to line 74 and change the word maxBounce to "bounciness".
    The line should look like this:
    Code (CSharp):
    1.  JointLimits limits = new JointLimits {max = 0f, min = 0f, bounciness = 0f};
    3) Save the file and switch back to Unity. The code should now recompile without error.
     
  28. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    186
    We just submitted to the Asset Store the update mentioned in the post above.

    Changelog:

    Note: Please make sure you update to Unity 5.1 before you update DestroyIt to 1.3.2.

    v1.3.2 Updated GameObjectExtensions.cs to change the variable name MaxBounce to bounciness due to the variable name changing in Unity 5.1.
     
    Last edited: Jun 12, 2015
  29. Hamesh81

    Hamesh81

    Joined:
    Mar 9, 2012
    Posts:
    405
    Fantastic work Zangad and DeadlyAccurate! Thank you so much for spending the time to test this out :)
     
  30. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    186
    We just submitted to the Asset Store a 1.3.3 update to fix a couple more issues with joints.

    Changelog:

    v.1.3.3
    • Corrected the Roughness channel on the Metallic mask on the Destroyed Cog Box
    • Fixed an issue with Hinge Joints behaving erratically after the Unity 5.1 update. If you use DestroyIt's Support Points in your project, you'll notice it creates Fixed Joints now instead of Hinge Joints. NOTE: If your fixed joints ever seem "springy", increase the Solver Iteration Count in your Project Settings to around 20 or 30 (the default is 6).
    • Fixed a crash related to Hinge Joints on the #13 Hinge Motor scenario in the demo scene. We noticed this crash after the Unity 5.1 update. It occurs because the OpenCloseChest script is trying to set the hinge motor target velocity after the game object is destroyed. Unity 4 did not have a problem with this, but Unity 5 does. To fix this issue, all joints are now immediately removed from destructible objects when they are destroyed.
     
  31. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    Good afternoon. I have a question. I read that you have integrated with UFPS. Make integration ufps multieplayer?!? And if your system will have a big impact on performance in the multiplayer ? ( There Photon Pun) These 2 questions I was very concerned . I use ufps multeplayer. And very interested in integrating with them in buying your Asset . I have not had any updates? Will there be further updates?
     
  32. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    355
    Hi Alex3333,

    UFPS
    DestroyIt isn't completely plug-and-play integrated with UFPS, you have to add a piece of code to the UFPS bullets to tell them to deal damage to DestroyIt objects. It's not a difficult task, though. If you're interested, here's the link to the post that explains how to do it and provides a code snippet:
    http://forum.unity3d.com/threads/re...matic-destruction-system.251622/#post-1701174

    And here's a link to some code and a video on how to smash DestroyIt objects with a UFPS melee weapon:
    http://forum.unity3d.com/threads/re...matic-destruction-system.251622/#post-1831773

    Multiplayer Performance
    Whether or not DestroyIt has a big impact on performance in multiplayer has to do with many factors, but mostly boils down to how much information you pass over the wire to all connected clients. If you are running an authoritative server network with dozens of connected clients and want to sync state for every piece of destroyed object debris, and you also allow players to do large amounts of destruction at once (like rockets slamming into multiple cars and buildings), then as a rule of thumb performance will be poor. It's just too much information going over the network.

    If on the other hand your game only has a few connected clients at once (like Left for Dead with only 4 coop players) or you allow destruction and the resulting debris state to be synced in a non-authoritative fashion, or your game only allows a limited amount of large-scale destruction (few or no area-effect weapons), then there's no reason why you can't have immersive environment destruction and good performance over multiplayer. Essentially, it's all about choosing what's most important for your game.

    DestroyIt has quite a few tools for keeping performance smooth: you can limit destruction to particle effects for things that are in the distance, there is a Debris Manager that allows you to control the total amount of destruction in the scene at once, and destroyed objects are automatically pooled which allows you to front-load object instantiation on game startup.

    Photon PUN
    We've done a successful multiplayer test with Photon PUN and made a quick video of it in action. Here's the information link that shows you how to get started:
    http://forum.unity3d.com/threads/re...destruction-system.251622/page-2#post-1951372

    Updates
    As general rule, we try not to update DestroyIt unless it's needed or we have significant new features to add. Even then, we usually wait and combine smaller updates into a larger release to avoid disruptive micro-updates. We've added a number of updates from customer requests and discussions in this forum, so if there's something you'd like to see added, please let us know. We just had an update about 3 weeks ago and a major Unity 5 update before that, and we have no plans to stop development on DestroyIt anytime soon.
     
  33. alecie

    alecie

    Joined:
    Sep 2, 2013
    Posts:
    73
    Hey there, any idea why my object isn't being destroyed? I've added Destructible Script and dragged Destroyed Prefab like in video tutorial, but no matter how many times i hit it with object it doesn't get destroyed.

    Test prefabs like suvs, trees and walls, work though.
    (suv hasnt got glass material, wall destroyed has no texture)
     
  34. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    355
    Hi Neomex,

    Are you doing this in a new scene? If so, did you click Window => DestroyIt => Setup-Minimal? Doing that adds the necessary DestroyIt scripts (DestructionManager, MaterialPreloader, ObjectPool, etc) to a game object in your scene for you.

    If you did do the minimal setup, are you getting any errors? If not, can you create a new clean project and import DestroyIt by itself, and does the demo scene run fine then?

    If you're still having problems, feel free to send us your project and we'll take a look at it. You can upload it to Dropbox (or similar) and send us a link here:
    support@modelshark.com
     
  35. alecie

    alecie

    Joined:
    Sep 2, 2013
    Posts:
    73
    Thanks for quick reply.
    I somehow managed to make it destroy itself (I honestly have no idea what I did), I had the setup minimal from the start. But now it spawns Destroyed Prefab rotated + most of the objects go through ground either halfway or fully. All the parts in Destroyed Prefab have convex mesh colliders and they work fine when added to scene by themselves.

    I have even written my own simple CustomDestroyed script, but it is useless without pooling.

    Do you have an idea what might be wrong, or should I send the project? (it is 1gb uncompressed)
     
    Last edited: Jul 11, 2015
  36. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    186
    Could you upload the project to Dropbox or something similar and email us the link, and we'll take a look at it first thing tomorrow?
     
  37. alecie

    alecie

    Joined:
    Sep 2, 2013
    Posts:
    73
    Ok, I have sent you an email.
     
  38. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
  39. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    186
    If there are undestroyed and destroyed prefabs in the pack, sure! I watched the video, and that seems to be what they're using, but you might double-check with the asset maker first. If they're using some kind of mesh-cutting system to destroy the objects, then there are no pre-destroyed prefabs to switch to with DestroyIt.
     
  40. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    AREA OF EXPLODING EFFECT

    I have seen that in the main demo scene, the columns are near one to each other, if you shoot some of them, they explode and with also make explode the next one near this, so I wonder how is configured the area of where the exploding effect will also damage other additional things?

    I have put 2 prefactured walls, one separated by 3 meters from the other, if I destroy one of them, the other one is also destroyed after the first one.

    MAKE PREFAB FOR DESTROY OBJECTS IN PARTS INSTEAD OF BROKEN PIECES?

    I have seen the manual and the video tutorials, but there is something that I still do not know, and is how to explode things in parts, not in broken pieces. I mean like the 11 and 12 examples (Box with the Gears) in the demo scene, or if I have a box with 5 parts separated in meshes, but inside the same gameobject.

    How do you make the prefab to destroy a gameobject into the separated parts (meshes inside a game object) instead of broken pieces?

    I Mean that in the other way you have the undestroyed and complete 3D model, and then you replace it with the destroyed prefab in the destructible script, but do not how to do it with the gameobject in separated parts, are both the same gameobject prefab ? (as there is already including the parts separated inside)

    Maybe I am missing something, or misunderstanding how this is done, or I am missing something in the manual or in the video tutorials.

    Thanks very much for any possible help

    ALREADY ANSWERED QUESTIONS

    Thanks for the answer, so what is needed then to see in the asset store if they have the undestroyed and destroyed prefab separated. and must not be used any kind of scripts to destroy the objects themselves, must be already pre-destroyed. Good to know.

    Thanks very much for this answer, is helpful and useful to know about this topic
     
    Last edited: Jul 29, 2015
  41. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    355
    Hi SpaceRay,

    When the rocket hits, it does a SphereCast to capture all objects in the blast radius, and if those objects are destructible, it will apply damage to them. It also applies force to the objects if they have rigidbodies. It's common for chunks of flying debris to strike other objects and damage them, as well. But I think what's happening in your case is the rocket is configured by default to have a 6m radius of splash damage. So if your walls are 3m apart, that would explain why both walls are taking damage. The 6m radius is pretty big, as you can see here:



    You can adjust the blast radius (as well as other parameters) on the Rocket script located on the Rocket prefab (DestroyIt - Core\Prefabs\Weapons\Rocket):



    I think you're on the right track. There really isn't much difference between a wall that breaks into debris chunks and a mechanical device that explodes into gears and gizmos. But creating destroyed prefabs isn't something we've covered very extensively, so I thought it might help to create a video that walks through my process.



    I hope this helps. Please let us know if you still have questions.
     
    Last edited: Sep 18, 2017
    julianr likes this.
  42. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    WOW!! Thanks for your fast and complete answer for both, surely in the way you do it is very helpful

    You surely give one of the best support and you are really helpful, and answer all the question in a great way that is easy to understand and solve the question.

    Thanks very much for making the video for explaining how to do the prefab for parts, that is so very well done and easy to understand, and also thanks for answering of the area explosion very well so now I understand it well.

    HOW TO CONFIGURE THE EXPLODING PIECES IN THE QUICKSTART DEMO SCENE OR IN THE EXAMPLE 1 (SIMPLE VERSION) MAIN DEMO SCENE

    1 - DestroyIT Minimal Setup - Includes the following

    1 - Material Preloader
    2 - Destruction Manager
    3 - Particle Manager
    4 - Object Pool

    I have changed the values included in these ones but it seems that whatever value I put always happens the same

    How these 4 four values are combined between each other to get the configuration you may want?
    Is there this explained already in the any of the Video Tutorial and I have missed it?

    In the pages 8, 9 and 10 of PDF is explained but does not work as expected, because changing this values it does not work as with the attached screenshot has high values and is the same.

    2 - EXAMPLE 1 MAIN DEMO SCENE


    Here is the columm destroyed without any destroyed prefab using only the destructible script and the Minimal setup

    2 - PAGE 3 OF PDF - DESTRUCTIBLE OBJECTS in 60 SECONDS! OR QUICKSTART DEMO SCENE


    This example is well explained and very easy to follow in a step by step way, doing everything very well, BUT there is something that is not told or I could not find it, or I misunderstood it

    How do you define how many pieces you want to use for the explosion on simple version?
    How many pieces are used by default on the simple version?
    How can you define the scale of the pieces on the simple version?

    I have seen that you can change the material of the pieces, but not the amount of them or scale
    I tried to change the amount to of max particles but this does not work
    Can you customize how this pieces are?

    Thanks very much for your help

    Best wishes
     

    Attached Files:

    Last edited: Jul 30, 2015
    zangad likes this.
  43. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    355
    Hi SpaceRay,

    It sounds like what you're wanting to do is change the size and number of particles for the default particle effects. I took some screenshots to illustrate how it's all wired together.







    Basically, if a fallback particle effect is specified on the Destructible script, it will use that effect for that particular destructible object. This is how you would control the particles for individual destroyed objects.

    If no fallback particle is specified, then either the DefaultLargeParticle and DefaultSmallParticle are used, based on the size of the bounding box of the destructible object (larger than 1.5m will use the large effect, you can adjust this). You can edit the default particle effects to your liking by changing the size, amount, speed, rotation, collision dampening, etc.

    What I usually do is make a copy of the default particle effect and then add smoke or dust or little bits of debris and then use that as a custom fallback particle.

    Hopefully that helps clear up any confusion. Let us know if you have questions.
     
    Last edited: Sep 18, 2017
  44. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    YES!!! The way you have explained very well, works very well, and you can control very easily this way the amount of default particles and the scale of them and it looks very well and impressive as seen on this screenshot that I made it with 300 particles and size 1.77 - 3.02 chunks to see how it works.

    Thanks very much again for your help!! Very helpful

    Have a nice day and best wishes
     

    Attached Files:

    zangad and DeadlyAccurate like this.
  45. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    355
    Hi everyone,

    We've just submitted a DestroyIt update to the Asset Store. Version 1.3.4 is primarily focused on performance optimization. A customer brought to our attention an issue with Garbage Collection Allocation when you have a significant number of destructible objects that also have destructible debris in your scene. So we made a performance pass and got GC Allocation way down, and also fixed a couple minor aesthetic things. Here's the changelog:

    DestroyIt 1.3.4 Changelog:

    Optimization: Destructible objects that also have destructible debris now get initialized properly when auto-pooled so there are no surprise Garbage Collection allocations at runtime.
    Optimization: Removed Linq queries and string concatenation on HeadsUpDisplay script to minimize Garbage Collection allocation.
    Optimization: Moved the code that sets the fallback particle material from FixedUpdate() to Initialize(), so it doesn't have to happen at destruction time if autopooling is enabled.

    Aesthetic Fix: Reflection probes on glass panes (Demo Scenarios #14 and #15) had intensity set too high.
    Aesthetic Fix: Reflection probe anchor overrides on SUV doors were getting set to the window anchor overrides when destroyed. Code was fixed so destroyed objects must have at least one matching TagIt tag in order to inherit their parent's probe anchor override.
     
    julianr likes this.
  46. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    @zangad - nice update list. Thanks!
     
    zangad likes this.
  47. khos85

    khos85

    Joined:
    Jul 21, 2013
    Posts:
    541
    I'm interested to buy this asset but have a few questions. I'm planning to use this where forces (Rigidbody.AddExplosionForce) are placed on any given object, will your asset detect how much force is placed on the object and fracture?
    Also can the fracturing be set so debris falls in diredction of the force, or have like an exploding effect?
    Sorry for all the questions, I'd like to try make sure this is the suitable asset for me :)
     
    zangad likes this.
  48. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    355
    Hi khos85,

    Our system isn't an auto-fracturing system, so it won't fracture objects for you automatically. Also, our asset doesn't detect forces in the scene (because many of those would be non-destructive). Rather, your exploding weapon would check for destructible objects within range and apply the force/damage to them.

    We already have several examples of explosions in our demo scenes (demo1, demo2) that you can use for reference or inspiration. Our rocket prefab for the rocket launcher weapon has a script on it that does exactly what you're wanting. We also have a gas can attached to the SUV in the SUV demo scene that will explode after a certain amount of damage, applying force and damage to all surrounding objects (usually lifting the back of the SUV as well as blowing out windows/tires and sending debris flying). And lastly, there's the nuke, which creates a huge wall (a trigger collider) that sweeps through everything in the scene, applying a massive amount of damage and force to rigidbodies and destructible objects.

    Here's the rocket from the demo scene, hitting a small lookout tower made of chipboard and wooden posts. As you can see, the explosion destroys the objects and the force sends them flying.



    The process is basically:
    1) Add the Destructible script from our asset to all objects you want to be damaged or destroyed by blasts.
    2) Add a small piece of code to your explosive weapon that checks for Destructible objects in range and applies the explosion information (blast radius, blast force, etc).

    Here's the explosion effect code you would add to your explosive weapon (ie, grenade, rocket, C4, etc). You're probably already doing some of the things in this code, you would just need to add the pieces that handle destructible objects.
    Code (CSharp):
    1. // This script goes on the explosive weapon.
    2. public class ExplosionEffect : MonoBehaviour
    3. {
    4.     public GameObject explosionPrefab; // The particle effect to use for the explosion.
    5.     public float blastRadius = 10f; // How far from the center of the blast the damage and force will reach.
    6.     public float blastForce = 250f; // The amount of force and damage the blast will have.
    7.     public float explosionUpwardPush = 1; // The upward "push" explosions have. Higher numbers make debris fly up.
    8.  
    9.     public void Explode()
    10.     {
    11.         // Create an explosion at a specific position with blast radius, blast force, etc.
    12.         ExplosionInfo explosion = new ExplosionInfo()
    13.         {
    14.             Position = transform.position, BlastForce = blastForce,
    15.             Radius = blastRadius, UpwardModifier = explosionUpwardPush
    16.         };
    17.  
    18.         // Find all objects in range of the explosion
    19.         Collider[] objectsInRange = Physics.OverlapSphere(transform.position, blastRadius);
    20.  
    21.         // Play explosion particle effect.
    22.         ObjectPool.Instance.Spawn(explosionPrefab, transform.position, this.GetComponent<Rigidbody>().rotation);
    23.  
    24.         foreach (Collider col in objectsInRange)
    25.         {
    26.             // If it's a Destructible object, apply damage to it based on proximity to the blast
    27.             Destructible destructibleObj = col.gameObject.GetComponentInParent<Destructible>();
    28.             if (destructibleObj != null)
    29.             {
    30.                 float proximity = (transform.position - col.transform.position).magnitude;
    31.                 float effectAmount = 1 - (proximity/blastRadius);
    32.  
    33.                 if (effectAmount > 0f)
    34.                     destructibleObj.ApplyExplosiveDamage(explosion.AdjustEffect(effectAmount));
    35.             }
    36.         }
    37.     }
    38. }
    Our system doesn't do any dynamic fracturing, so your debris will need to be pre-fractured and have rigidbodies on it. Our system will handle it from there - if your destructible object is destroyed by blast force, our system will swap out the destructible object with the destroyed prefab and apply the same blast force to its debris. The direction the debris moves is always determined by the force applied to its rigidbody, so nothing special there.

    Hope that answers your questions, let us know if you have more.

    [EDIT: Clarified how our system is not an auto-fracturing system and does not auto-detect forces.]
     
    Last edited: Sep 18, 2017
  49. StephenSpanner

    StephenSpanner

    Joined:
    Aug 18, 2015
    Posts:
    3
    Hey zangad/deadly,

    I was wondering if you could give me pointers on an issue i'm having working on my game.

    My game world city is made up of many low-poly buildings, each of which have individual walls that destroy into debris when vehicles are driven/smashed through them in force. All of which works incredibly well for the walls.

    Unfortunately I can't figure out the rooftops. When something smashes or damage the rooftops, the object shatters and fall down entirely. An example of a gas-station (taking a single hit in the corner) is shown here, here and here. I've tried a couple of techniques. First was to use support-points and cling-points on the beams, which don't seem to work. I tried going through the demo but had no luck. The second was to use kinematic rigidbody debris, which would switch to non-kinematic (in script) on collision... however this caused a problem with chunks floating in the air regardless of support, only to become active when collided with.

    I feel like i'm going about this the wrong way. Am I doing something unintended by the DestroyIt engine? Is this a job for the support/cling system, but I'm getting it wrong? Is there another method for this?

    Cheers!
    -Stephen
     
  50. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    355
    Hi Stephen,

    I think I understand what you're trying to do, and I think the cling points are the right way to do it. But you wouldn't put the cling points on the beams, you'd put them on the debris that's getting destroyed, and point them towards the beams.

    So you should only need cling points on the debris pieces that will be in contact with the beams. That way when the roof is destroyed, the pieces in contact with the beams will become attached to the beams.

    Please let us know if you still have issues.