ModelShark Studio is happy to announce DestroyIt, a cinematic destruction system for Unity Free and Unity Pro!
NEW in v1.13!
Version 1.13 includes a custom Shader Graph shader for URP, which allows you to have progressive damage textures on your Universal Render Pipeline materials.
Another new feature is the auto-deactivate destructibles, for when you have thousands of destructible objects in your scene.
The framework provides throttling tools for performance, material pre-loading and transfer for seamless visuals, a particle manager, and object pooling. A wealth of particle effects, sample destroyed prefabs, and documentation are also there to get you started. DestroyIt was designed to meet the following requirements:
Highly Scalable
DestroyIt comes complete with a Destruction Manager, a Particle Manager, Object Pooling, and a Material Preloader for high performance.
Realistic Destruction
DestroyIt was designed to use destroyed prefabs that break apart realistically and produce convincing, persistent debris. Flying debris can damage players and enemies, and can also be used for cover, which creates emergent gameplay.
Emergent Gameplay
When objects can be destroyed into realistic debris, it adds a facet of emergent gameplay and player choices that goes beyond visual effects. Create walls that can be breached; towers that can topple; and trees that can be chopped down.
What You Get
-
Full C# source code, no DLLs
-
All Particle effects shown
-
Progressive damage shaders, with textures
-
Demo that illustrates all core features
-
Demo that showcases many features using Unityâs free Shanty Town SUV model.
-
All demo scene assets
No programming knowledge is necessary but is helpful if you want to extend the system.
Check out the demo!
Written instructions for the destructible trees can be found here: http://www.modelshark.com/Content/DestroyIt-Destructible-Trees.pdf
If you have urgent questions, please send us an email. The forum doesnât always let us know a post has been made.
Always back up your project before updating your package.
Changelog
Changelog:
v1.15 (Apr 2022)
Note: Version 1.15 of DestroyIt is for Unity 2020 and above. Use 1.14 or earlier for older installations of Unity.
New Features
- Added audio clip fields to the Destructible script, so it can play sounds when the object is damaged, repaired, or destroyed.
- Added ability to scale Damage Effects prefabs on the Destructible script, much like how Fallback Particle Effect lets you override the scale on the Destructible script.
- Added âLimit Damageâ checkbox to Destructible script, so you can now specify Max and Min damage per hit, plus the minimum amount of time (in seconds) that must pass before the object can be damaged again. Really useful when you need rigidbody collisions to do a more predictable amount of damage.
- Added a checkbox to DestructionManager that allows you to globally enable/disable damage to Destructible objects. This lets you turn on/off damage to destructible objects in one place.
- Added Custom DestroyIt HDRP Lit shader and updated the DestroyIt User Guide on how to use it.
- Fallback Particle Effects can now be set to Parent Under a transform. This is helpful for when you need the particle effect to follow along under a different game object.
Minor Updates
- Updated: Code to work with Unity 2020.3.32f1 (LTS)
- Re-centered the demo scenes so when they are opened for the first time (at world position 0,0,0) you see the scene correctly, instead of seeing a dark area with no terrain.
- Removed the âDestroyIt-Readyâ feature and removed the mentions of it in the User Guide PDF.
- Added a ShockwaveSphere script, which is similar to the nukeâs Shockwave Trigger Wall script, but this one moves out as a radius from the initial blast instead of as a wall.
Bug Fixes
- Damage Levels were not recalculating when totalHitPoints were modified at runtime through code. TotalHitPoints and CurrentHitPoints are now public properties with backing fields.
- DamageLevel hitpoint ranges are no longer cast to integers, which was causing an issue with destructible objects with very low hit points (ie, 5hp total with 5 damage levels) not progressing to the next damage level properly.
- Set ObjectPool container to inactive to prevent unwanted OnEnable events (such as destroyed sounds) when scene starts.
- ObjectPool no longer throws errors about âkey already exists with that instance IDâ when using nested prefab copies of Destructible objects.
- Moved the Particle Alpha (no fog) shader out of the âDemos (safe to delete)â folder, because the default particles use them and they are therefore required for the main DestroyIt asset. Now you can delete the Demos folder and not get pink textures on the default particle effects.
- Objects with DontDoDamage tag were doing damage to static destructible objects and destructible objects without rigidbodies.
- Issue with HitEffects where it was only playing the first effect found. Now plays all effects.
- Small issue with StructuralSupport script where it would only remove joints that had connected rigidbodies. Changed it so it removes all FixedJoints.
v1.14 (Apr 2021)
- Updated to Unity 2020.3.4f1 (LTS)
- New Feature: You can now override the fallback particleâs mesh materials and scale, regardless of whether itâs a custom particle effect or the default (unassigned) one.
v1.13 (Apr 2021)
- Updated to Unity 2020.3.2f1 (LTS)
- Two new URP Shader Graph shaders were added to support the Universal Render Pipeline with progressive damage textures.
- Destructible terrain trees now support parent LOD Group components, so they are able to randomly rotate when painted on terrain.
- ChipAwayDebris was modified so it now removes any non-kinematic rigidbodies it finds on the destroyed prefab before spawning in.
- New Feature: Structure-Supported Debris (Scenario #30). Allows you to quickly add structural support joints to fractured debris so it stays together.
- Added the text âREPAIRâ to the wrench HUD UI so itâs more obvious that itâs a repair tool, not a weapon.
- Destructible terrain trees are now hidden when destroyed and remain part of the terrain data, removing the need for resetting tree instances and terrain height.
v1.12 (Jul 2020)
Major Changes
- Added PlayMaker support for Destructible Actions (Damage, Repair, Destroy) and Events (OnDamaged, OnRepaired, OnDestroyed) and illustrated it with a new PlayMaker demo scene (under Extras).
Bug Fixes
- Changed RepairDamage(int) to RepairDamage(float) on the Destructible script in order to support both float damage and repairing.
- Destructible scripts would process collisions and take damage even when disabled. Now you can disable Destructible scripts and they will not process collisions, as expected. (Note: Destructible terrain trees still process collisions and take damage when the Destructible scripts are disabled, as intended).
- Added a safety check in GetMeshCenterPoint() method to fix errors when a MeshFilter does not have a shared mesh.
- Added safety checks to all code that un-registers an event when OnDisable() fires, to prevent the possibility of null reference exceptions.
- Added a safety check to the ExplodeAfter.cs script to handle if there is no explosion prefab provided.
- Fixed: Debris from ChipAwayDebris objects that were reparented to moveable objects would move along the ground with the object.
- Fixed: Mesh center point calculation for static meshes changed from gameObject.isStatic property to meshRenderer.isPartOfStaticBatch property.
- Fixed: Debris from destroyed objects which were added to the Object Pool manually (or not pooled at all) were not being initialized/configured properly, and velocity was not being tranferred to the debris after spawn.
Minor Changes, Cleanups, and Enhancements
- Updated DestroyIt to Unity 2019.4.5f1 (LTS).
- Added the WhenDamagedDamageParents script, so you can have Destructible objects damage their parents when they are damaged.
- Added public Destroy() method that can be called on a Destructible object to destroy it immediately.
- Cleaned up QuickStart demo scene, removing unneeded terrain and textures.
- Created a PlayMaker action that applies damage to a Destructible object (DamageDestructibleObject)
- Created a PlayMaker action that destroys a Destructible object (DestroyDestructibleObject)
- Created a PlayMaker action that repairs a Destructible object (RepairDestructibleObject)
- Added a script to send the Damaged event from a DestroyIt Destructible to PlayMaker.
- Added a script to send the Repaired event from a DestroyIt Destructible to PlayMaker.
- Added a script to send the Destroyed event from a DestroyIt Destructible to PlayMaker.
- Added a new demo scene that illustrates how to use Playmaker actions and how to listen to DestroyIt Destructible events (under Extras)
- Updated DestroyIt User Guide, adding a section on how to use the new PlayMaker Actions.
- Extracted the DestroyIt-Ready user guide from the nested asset package and placed it at the root of the Extras folder, so you can read it without needing to unpack anything.
- Renamed ObjectPool container to âDestroyIt_ObjectPoolâ instead of â_ObjectPoolâ to avoid conflicts with other object pooling systems.
- ObjectPool now checks for an existing object named âDestroyIt_ObjectPoolâ and uses it instead of always creating a new container object regardless.
- Mesh center point is now only calculated for a destructible object if it uses a fallback particle effect.
- Added a Debug.Log for when you have a Destructible object with one or more static meshes, but no position override for the fallback particle effect. âParticle effect may not spawn where you expect.â
- On the Destructible script, if you use a Material Override for a particle effect, the system now applies progressive visual damage on the override material if it supports it.
- Scenario #27 (Static Meshes) in the Main Demo Scene is now split into three separate variations of the scenario, for clarity and testing.
- Angular Velocity is now also tranferred to debris from the Destructible object that spawned it. (Before, it was only Velocity that was transferred.)
v1.11 (Apr 2020)
- Updated for Unity 2019.3.7f1 compatibility
- Improved memory performance for progressive damage and destroyed prefab material transfers by modifying MaterialPropertyBlocks instead of directly changing materials at runtime
- Removed the MaterialPreloader script entirely, as it is no longer needed to boost performance by creating hundreds of material variations at runtime
- Removed the need to put progressive damage materials in the Resources\Material_Preload folder. You can put them anywhere now, and they will work fine
- You can now make objects destructible even when they have no colliders or rigidbodies (see Scenario #29 in the Main Demo Scene). You can still apply damage to these objects through the normal ApplyDamage() method. Useful for things like scripted or far-off damage effects that the player cannot interact with
- Fixed âmissing GUI Layerâ warning on Main Camera component in QuickStart scene (Unity 2019-related)
- Fixed an issue with detail masks and texture maps being incorrectly used by the Material Preloader for progressive damage textures (Unity 2019-related)
- Fixed âCheck Windingâ error caused by one of the SUV meshes
- Added option to backup terrain in TreeManager because of âThe specified path is not of a legal form (empty)â bug in Unity (Unity 2019-related)
- Repackaged DestroyIt-Ready as a separate package bundle to prevent build-time errors
- Fixed âCouldnât create a Convex Mesh from source mesh ârock_lowâ within the maxinum polygons limit (256)â error (Unity 2019-related)
Notes:
- If you are applying this update to an existing project, you may get a âmissing scriptâ warning for the MaterialPreloader component. You can safely remove this component, as it is no longer needed
- While we were able to improve memory performance for progressive damage and destroy prefab material transfer operations, we were not able to improve material transfers to mesh particle effects. Destructible objects that spawn particle effects that have materials transferred over to them will still create one material per renderer, per effect. This is due to a bug in Unity that causes MaterialPropertyBlock changes to not take affect on ParticleSystemRenderers that are set to RenderMode:Mesh. If you want to keep your material usage super-clean, manually assign your fallback particle effects rather than relying on the defaults (example: Scenario #4 - The Exploding Barrel in the Main Demo Scene).
Known Issues:
- When importing the DestroyIt asset package, you may get an error message âA tree couldnât be loaded because the prefab is missingâ, even though there are no missing tree prefabs on the terrain in question. In this case, it is not a real error and can be ignored. Best we can tell, this is happening because we use a customized version of the SpeedTree shader for destructible trees, because it thinks the prefab doesnât have any valid mesh renderers when it actually does. It works fine, though, both in the editor and building the scene.
- If you turn on the Backup Terrain feature on the TreeManager script and you have the solution open in Visual Studio, you may get an error message âThe specified path is not of a legal form (empty)â thrown from the TreeManager script. This error is not a real error and can be ignored.
v1.10.2 (Mar 2019)
- Removed ResetTreeWhenDestroyed script from the demo scene tree in the Main Scenarios scene. Feature has not yet been implemented.
- Corrected ImportFBX errors on demo meshes.
v1.10.1 (Feb 2019)
- Fixed a bug in the DestroyIt-Ready destructible converter script that would happen when an entire folder of Destructible Stub prefabs were selected.
v1.10 (Jan 2019)
Major Features
- Support for destructible terrain trees.
- New Auto-Activate feature on DestructionManager script allows you to have thousands of deactivated destructible objects in the scene and activate them when player is near.
Unity Version
- Updated DestroyIt to Unity 2018.3
Enhancements/New Features
- Blast effects (rocket, nuke, various explosions) now apply damage using both BlastForce and BlastDamage parameters instead of only BlastForce.
- Rocket and Explode scripts modified so they have three blast radii - Point Blank, Near, and Far. You can adjust the damage and radii of all three.
- Added new SpawnObject script to spawn particle effects directly from the object pool.
- Improved the way AutoPooling works - Destructible scripts insert objects into the pool instead of the ObjectPool looking for Destructibles in the scene.
- Implemented auto backup/restore process for terrainData tree changes in the Unity Editor if Unity crashes.
- Implemented process to save destructible tree stand-ins to a hashed Resources path so you can manage destructible drees for multiple scenes without conflict.
- Hit points of destructible objects can now have decimals.
- New menu option Window â DestroyIt â Setup - First Person Controller adds a first person controller gameobject with camera and pre-configured weapons to your scene.
- InputManager was moved from the GameManager to the FirstPersonController prefab.
Particle Effects
- Added LeafBulletHit, LeafParticleEffect, and LeafParticleEffectHeavy.
- Updated all particle effects to use the 2018.3 particle shaders.
Bug Fixes
- Fixed DestroyIt Mobile shader to correct an error reported in the console, and to fix the progressive damage texture.
v1.9 (Jun 2018):
- Updated DestroyIt to Unity 2018.1
- Replaced wooden chest (Main Scenarios Scene, #14) with a model that uses a single material
- Fixed explosion effect on explosive barrel (Main Scenarios Scene, #4)
- Cleaned up meshes in demo scenes (removed n-gons) to correct texture import warnings
- Removed legacy shader for palm tree (Main Scenarios Scene, #21)
- Fixed rotating particles on ConcreteDebris particle effect
- Removed FadeTreeSwaying script since it only worked with legacy nature shader
v1.8 (Apr 2018):
- Updated the Nuke weapon particle effect
- Replaced demo object #4 with a gas barrel model and replaced the explosion with one from the Unity Particle Pack
- Replaced demo object #10 rock with a new rock
- Retextured demo objects #12 and #13, cog box, and reduced number of textures used
- Modified demo objects #17 and #18 targets to use only a single material
- Adjusted the height and angle of the Nuke trigger GameObject on the First Person Controller
- Reduced the size of several textures: track blinds, flag, pipe wrench, and rocket launcher sight
- Modified the Flag prefab GameObject to remove the Hinge Joint due to Unity no longer allowing non-convex colliders to work with non-kinematic rigidbodies
1.7.1 (Jan 2018)
- Cleaned up Standard Assets references so there are no assetId conflicts with DestroyIt when importing any Standard Assets package.
1.7 (Dec 2017)
Fixes:
- Updated to Unity 2017.2
- Fixed muzzle flash particle effect for M4 rifle - now uses custom simulation space to stay attached to rifle muzzle.
- Removed unused JavaScript Standard Asset scripts.
- Fixed missing references for rocket launcher on Mass Destruction Demo scene.
- Fixed object pool warnings on SUV Showcase Demo scene when restarting the scene with the âRâ key.
1.6 (July 2017)
Enhancements:
- Updated DestroyIt to Unity 5.6.2.
- Added a Mobile-Friendly Blinn-Phong lighting shader that supports progressive damage (see Main Demo Scene: #26).
- Added an ALL DEBRIS option for the Reparent Debris field on the Destructible script.
- Added ability to assign a parent for the destroyed prefab on the Destructible script.
- Added option to turn kinematic off on unparented child rigidbodies (itâs still on by default).
- Added option to override the Fallback Particle position (especially useful for static meshes, see Main Demo Scene: #27)
- Added option to set kinematic True/False for reparented debris (such as the longsword in Main Demo Scene: #19)
Minor Enhancements/Optimizations:
- Minor visual effects tweak (CogBox): Progressive damage is now more obvious, sparks particle effect render queue now based on shader so smoke doesnât hide it.
- Optimized the demo scenes to work with Gamma lighting (Unityâs default). Better visuals for mobile and WebGL builds of the demo scenes.
- Optimized the demo terrain by reducing it to 512x512 and rebuilding the splatmaps. Greatly reduced build size for demo scenes.
- Added a âChoose Demoâ scene and wired it up to the Main Scenarios Scene and SUV Showcase Scene by use of the Main (M) button.
- Added a Loading Screen and WebGLWarmUp object to demo scenes which pre-destroys objects in the scene to help WebGL build performance.
- Removed âTag Debris Asâ from all scripts and editors (no longer needed - use HitEffects script instead).
- Added many tooltips to the Destructible editor script to explain the various options and when you would use them.
New Scenarios in the Main Demo:
- Scenario #25: Dynamically adding a destructible object to the scene at runtime.
- Scenario #26: Mobile shader for DestroyIt that supports progressive damage.
- Scenario #27: Static meshes and using the fallback particle position override.
Bug Fixes:
- Destructible objects set as static were invisible when the scene loaded, because GetMeshCenterPoint was accessing the mesh instead of sharedMesh.
- Added more null checks to DestructionManager so errors will not be thrown if DestructionManager doesnât exist but there are Destructible objects in the scene.
- Added [DisallowMultipleComponent] attribute to Destructible, TagIt, and HitEffects scripts to prevent putting more than one of these components on a game object.
- Fixed all âobsolete referenceâ warnings from previous version of Unity.
- Removed Interpolate rigidbody setting on destroyed prefabs and Time Slow (T) feature because of a known issue with Unity 5.6.
- Fixed bug related to destructible objects that have destroyed prefabs which are also destructible (now recursively adds destroyed prefabs to the object pool).
- Demo Scenes: When your HUD (âHâ) or Reticle (âOâ) was toggled off and you started the scene, you had to press these keys twice to toggle them on.
- Added a null reference check to the Material Preloader in case you donât supply a source material when adding a Material Replacement.
1.5.3 (February 2017)
New Features:
- New HitEffects system. You can now specify different particle effects for each weapon/projectile type that hits an object. Also, you no longer need to place TagIt scripts on each collider that needs a different hit effect. You can now place a single HitEffects script on the parent and override individual colliders as needed. See the DestroyIt user guide for more info.
Minor Changes:
- Removed many old/unused assets from the package, saving approximately 20MB.
- Moved SUV Showcase demo scene to its own folder.
- Added HitEffects to DestroyIt-Ready system, so HitEffects scripts can now be converted to stubs that can be packaged with your own commercial assets.
Bug Fixes:
- Corrected several bullet hit particle effects and re-centered the wood splinter meshâs center point.
1.5.1 (January 2017)
- Corrected several bullet hit effect particle effects that were rotating on the ground
- Recentered the wood splinter meshes center point
1.5 (December 2016)
We suggest that you delete your existing DestroyIt folder before importing the newer one, but please back up your project first!
Major Changes:
- Updated for Unity 5.5.
- Progressive damage system overhauled to allow more control of damage levels and visible damage.
- Damage can now be repaired, and any damage level effects will turn off as the object is repaired.
- For each Destructible object, you can now have from 1 to 10 Damage Levels, and the hit point range can be customized for each.
- All Destructible objects now start with 5 pre-defined Damage Levels.
- Destructible objects now automatically detect if they are damaged or destroyed based on current hit points, rather than relying on external ApplyDamage() or ProcessDestruction() calls.
- Performance increased by reducing Garbage Collection allocation on PlayDamageLevelEffects, HeadsUpDisplay, ReleaseClinging Debris, Bullet Update() method, Object Pool Spawn() method, and by removing the JointCleanup script.
Minor Changes:
-
Damage masks extended from previously 5 levels of progressive damage to 10.
-
Many tooltips added to Destructible and DestructionManager script fields.
-
DestroyIt-Ready: You can now select a root folder in the Projects pane and click Convert Stubs to Destructible and it will find all prefabs under that folder.
-
DEMO SCENES
-
Removed unnecessary reflection probes and increased resolution of main reflection probe.
-
Bullet streak enhanced for a more visual, âtracer-likeâ effect.
-
Updated HUD UI to Unity Canvas.
-
ADDED: Performance, Keyboard/Mouse Controls, and Current Weapon sections to in-game HUD UI.
-
ADDED: Repair Wrench animated weapon with particle effect, to show off new Repair Damage feature.
-
DELETED: Some unused standard assets that were throwing warnings.
-
Changed to Linear lighting, tweaked tonemapping and blur camera settings, re-enabled light flares on SUV, changed reflection probes to baked lighting.
-
Removed âDraw Call Batchingâ scenario. Unity 5 now uses setpass calls and batches, making âdraw callsâ an inaccurate performance metric.
-
New cannon, repair wrench, and RPG models.
-
New brass pole, wall, longsword, and sconce models.
-
Mouse wheel can now be used to cycle through weapons.
-
Enhanced particle hit effects for metal, cloth, concrete, dirt, glass, and wood.
-
REMOVED: support for progressive damage on materials using legacy Unity 4 shaders.
-
REMOVED: Debug Monitor from Destructible script.
-
REMOVED: ForceCollisions script, it is no longer needed with Unity 5âs physics.
-
REMOVED: unused progressive damage mask images.
-
Destructible custom editor script re-categorized, and fields moved to provide clarity.
-
Changed ApplyImpactDamage, ApplyExplosiveDamage, etc to ApplyDamage overload methods.
-
Refactored Damage types so they inherit from a generic Damage interface.
-
ADDED: Repaired event that fires when a Destructible object is repaired.
-
ADDED: Damaged event that fires when a Destructible object is Damaged.
-
ADDED: WhenDestroyedPlaySound.cs helper script for playing sounds when a destructible object is destroyed.
-
ADDED: WhenDamaged.cs helper script for taking action when a destructible object is damaged.
-
ADDED: WhenRepaired.cs helper script for taking action when a destructible object is repaired.
Bug Fixes:
- DestroyIt-Ready: Converting stubs/destructibles on Unsaved Scene caused undesired scene save popup.
- DestroyIt-Ready: Converting a game object and its prefab at the same time caused duplicate scripts to be added.
- Destructible objects can no longer be damaged into negative hit points.
- When rotating a Destructible object with Damage Effects, the Damage Effects particles and gizmos did not rotate with the object.
1.4.2 (April 2016)
- FIXED: Editor scripts have been updated to use the EditorSceneManager introduced in Unity 5.3. This change was required for editors to save user modifications properly.
1.4.1 (April 2016)
- Added: TagItStub script so you can make DestroyIt-Ready assets that use TagIt scripts.
- Added: New option on Destructible script âIgnore Collisions Under Magnitudeâ, which is useful for things like destructible tires, which should ignore most small-to-medium collisions yet still take full damage from bullets.
- Fixed: Particle systems will no longer have DamageMaterial scripts added to them at runtime. This was a bug introduced by adding SkinnedMeshRenderer support.
- Sink Into Ground option on Destructible script is now only available if the Destructible object has a rigidbody.
- Bullets and the Axe melee weapon will now ignore trigger colliders.
- The Axe melee weapon will now ignore the CharacterController tagged as âPlayerâ. This will prevent the player from hitting himself with the Axe.
- Object Pool importing and saving improved. You can now import/save object pool files to different locations. When importing a file, it will now update existing objects in the pool instead of replacing all objects. Also added a Clear button to quickly remove all objects from the pool.
1.4 (March 2016)
- Added: DestroyIt - Ready. You can now make your own DestroyIt objects for commercial purposes.
- Added: Skinned Mesh Renderer support for non-organic skinned mesh renderer objects.
- Fixed: Warnings for deprecated properties and methods from Unity 5.2 and 5.3
- Fixed: Mouse cursor not immediately visible when running in Unity editor and pressing Esc.
1.3.5 (February 2016)
- Fixed the Particle Alpha Blend (No Fog) shader for Unity 5.3, so textures using that shader no longer appear pink.
1.3.4 (August 2015)
- 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.
1.3.3 (June 2015)
- 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.
1.3.2 (June 2015)
Note: Please make sure you update to Unity 5.1 before you update DestroyIt to 1.3.2.
- Updated GameObjectExtensions.cs to change the variable name MaxBounce to bounciness due to the variable name changing in Unity 5.1.
1.3.1 (Apr 2015)
- Fixed an NRE that could occur with the material preloader.
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 ( Cursor Lockstate Troubles - Unity Engine - Unity Discussions ). 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.
1.2 (Jan 2015)
Enhancements
- Added FadeOut script. When attached to a destroyed prefab, strips colliders and rigidbodies from debris after a set amount of time and fades them out with a transparent shader.
- TGA texture files converted to .PNG format. (Saved 105 MB on the package download size.)
- Added three new damage masks, âRandom Growthâ, to give you more variety for progressive damage.
- Transparent Reflective progressive damage shaders were improved to enhance the look of the damage. This can be seen in the shattered glass effect in the demo scenes.
- New shattered âsafetyâ glass texture and normal map added.
Fixes
- Changed âDebrisâ layer to âDestroyItDebrisâ to resolve a conflict with UFPS, which uses a layer by the same name but for a different purpose.
- You can now save/load your ObjectPool entries if you have renamed your DestroyIt - Core folder.
- HUD in the demo scenes can now be turned on/off independently of the targeting reticle.
- Impact rigidbodies (like the cannonball) will now have their momentum correctly maintained when destroying an object as a particle effect.
- Removed back face on Glass Pane in demo scene and fixed UV stretching issue on a couple of the broken shards. This also fixed the glass shards flickering when they fall.
- Fixed a lighting issue with Specular progressive damage shader - it was darker than the Bumped Specular version.
- Fixed Scenario #10 in demo scene, where sconce bulb was âflashing outâ even when not tagged as Powered.
1.1 (Oct 2014)
Note: Damage-Level Particle Effects on the Destructible script was renamed to Damage Effects. You will need to re-assign damage-level effects in your projects if you have previously used this feature.
New Features
- Chip-Away Debris Allows you to make debris cling to a solid core structure of your destroyed prefab. Useful for columns or walls that have solid rebar centers. Debris can be chipped away from the rebar once the object is destroyed.
- Tag All Debris As⌠You can now tag all debris pieces automatically with the âTag All Debris Asâ checkbox. Each piece of debris will be assigned the TagIt script with the appropriate tag when the Destructible object is destroyed.
- Save/Load Object Pool Entries You can now save and load your Object Pool entries to a file with the new Save/Load buttons on the Object Pool editor.
- Auto-Pool Destroyed Prefabs By default, destroyed prefabs will now be auto-added to the object pool when the scene starts. This has several performance benefits: materials are pre-transferred to the destroyed object, debris rigidbodies are pre-referenced, and debris is pre-tagged. You can turn this feature off if needed. For instance, if your destructible objects need their materials changed dynamically through gameplay.
- Parent Under Object (ClingPoints) When selected, strips the rigidbodies off the debris piece and parents it under the object it clings to instead of using a hinge joint. Provides better performance and a rock-solid joint.
- Re-parent to Destroyed Prefab Allows you to choose one or more children under the destructible object that will be re-parented under the destroyed prefab. This is useful for things like car doors that have a window child, which needs to be reparented under the destroyed prefabâs door. (See SUV Showcase scene)
Enhancements
- Damage-Level Particle Effects were renamed Damage Effects, and can now be any game object, they donât have to be a particle effect. This allows you to use any game object with (or without) a script as a Damage Effect, so you could for instance make an object shudder at a certain damage level, or do a post-processing effect of water droplets on the camera when a water barrel is destroyed at close range.
- Added a Showcase SUV Scene that illustrates whatâs possible with the many features of DestroyIt.
- When trying to do material transfer, system now logs a warning if the material was not found in the Resources folder.
- Support Points now display friendlier error messages when no collider is found on a gameobject with a support point.
- Updated asset to support Unity 4.5.4.
- Updated code to use the new Unity 4.5 GetComponentInParent() method, which significantly improved performance for recursive parent lookups.
- Improved material transfer from undestroyed to destroyed prefab with the option to âauto-poolâ the destroyed prefabs. This option pre-transfers the materials to the destroyed prefabs on game Start().
- Improved performance by converting several âforeachâ statements to standard âforâ loops.
- Improved performance by converting several critical path C# generic List members to standard arrays.
- Improved performance by moving the GetComponentsInChildren() check for debris ClingPoints and rigidbodies to game Start() when using auto-pooled destroyed prefabs.
- Added new particle effect for bullets striking rubber tires.
- Added new particle effect for bullets striking cushion stuffing.
- Added Damage Bumped Reflective shader.
- Improved Transparent Reflective shader to better handle curved glass.
Bug Fix
- Destructible script no longer throws exception when assigning multiple replacements for the same material. It logs a warning instead and skips that material replacement at runtime.
----
1.01 Hotfix (Jul 2014)
- FIXED: When dragging Destructible script onto a gameobject, receive multiple null reference exceptions from Destructible and DestructibleEditor scripts.
DestroyIt 1.0 (Jul 2014)
- Initial release
User Guide | Website | Demo |Youtube | Additional Screenshots