Search Unity

[Released] DestroyIt - Cinematic Destruction System

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

  1. fssdev

    fssdev

    Joined:
    Jan 16, 2017
    Posts:
    49
    The main wall has the Destructible script and references a prefab for the broken pieces. Each of those pieces has the Destructible script and references a prefab based off of their own model. That's the end of the chain, so final chunks do not have any scripts attached.

    I still can not figure out why the chunks of the original wall never disappear.
    Instead of disappearing and replacing itself with the broken pieces prefab, it remains in the scene and an infinite number of the broken pieces prefabs spawn out of it.

    how.JPG
    The selected chunk in the image shouldn't exist anymore, but instead it remains and spawns infinite prefabs.
     
  2. fssdev

    fssdev

    Joined:
    Jan 16, 2017
    Posts:
    49
    Oh me posting the error message might help:
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. DestroyIt.DestructionManager.InstantiateDebris[Damage] (UnityEngine.GameObject newObj, DestroyIt.Destructible oldObj, Damage damageInfo) (at Assets/DestroyIt/Scripts/Managers/DestructionManager.cs:401)
    3. DestroyIt.DestructionManager.ProcessDestruction[Damage] (DestroyIt.Destructible oldObj, UnityEngine.GameObject destroyedPrefab, Damage damageInfo, Boolean isObliterated) (at Assets/DestroyIt/Scripts/Managers/DestructionManager.cs:270)
    4. DestroyIt.Destructible.ApplyDamage (Damage damage) (at Assets/DestroyIt/Scripts/Behaviors/Destructible.cs:186)
    5. DestroyIt.DestructionExtensions.ProcessDestructibleCollision (DestroyIt.Destructible destructibleObj, UnityEngine.Collision collision, UnityEngine.Rigidbody collidingRigidbody) (at Assets/DestroyIt/Scripts/Extensions/DestructibleExtensions.cs:133)
    6. DestroyIt.Destructible.OnCollisionEnter (UnityEngine.Collision collision) (at Assets/DestroyIt/Scripts/Behaviors/Destructible.cs:328)
    7.  
    I tried adding the prefabs to the pool manually, but that didn't resolve it.
     
    Last edited: Jun 29, 2017
  3. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    172
    Can you send me your project (or a sample with the problem walls)? I might see something if I look at it.

    modelsharkstudio@gmail.com
     
  4. fssdev

    fssdev

    Joined:
    Jan 16, 2017
    Posts:
    49
    I sent you the downloadable link to your email.
    Thanks
     
  5. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    172
    Thanks. Downloading now.
     
  6. fssdev

    fssdev

    Joined:
    Jan 16, 2017
    Posts:
    49
    A few issues I've run into trying to troubleshoot infinite prefab instantiation:
    • When using the debris to re-parent feature, Is Kinematic is automatically turned on for all pieces. Cleans up the hierarchy, but then locks the movement of my pieces.
    • The debris is not being instantiated in the same spot as what it is replacing.
    • The infinite prefab thing seems to only happen when the destroyable object is being instantiated in real-time. If it is already sitting in the scene when the game starts, it does not instantiate infinite prefabs.
     
  7. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    172
    Debris To ReParent is intended to stick one object to another object, like reparenting a sword handle to a hand after the sword is destroyed. The line that turns kinematic on is in the DestructionManager, line 430.
    debrisRigidbodies.isKinematic = true;


    The second issue is usually caused by the pivot point on the mesh being off. You can fix it either in your modeling tool or by parenting to an empty game object in Unity.

    As an example, within your WallBroken_40x20x1, create an empty game object and parent Chunk1 under it. Zero out the transforms on the GameObject, and then make sure Chunk1 is lined up with your undestroyed mesh in the right spot (try 15.28, -1.28, 0; that's what my version is). Save the prefab and run. You'll need a zero'd out empty game object as the parent for each of the chunks.

    If you can get it correct in the modeling tool, that's obviously better, but sometimes it's just easier to fix in Unity.
     
  8. fssdev

    fssdev

    Joined:
    Jan 16, 2017
    Posts:
    49
    Update:
    I fixed the infinite prefab thing with some recursive code in the AddDestructibleObjectsToPool function.

    I'm not sure why my prefabs are now doing this thing where they dont instantiate in the correct place. It worked ok when I first started testing, now its broke and I'm not sure how to fix it. I'll play around with it and try your suggestions.

    Is there an easy way to keep the unity hierarchy organized without using the ReParent feature? It gets kind of hard to find things with hundreds of chunk fragments are filling up the list in real-time.
     
  9. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    191
    Hi fssdev,

    Our next update will include a new field on the Destructible script called "Assign Parent", which will allow you to specify a gameobject container for your destroyed prefab debris. This will help organize your destroyed objects and give you more control over cleaning them up.

    Here's a screenshot of the new field. It will appear in the editor once you have assigned a destroyed prefab. It's also always available from code, so you could (for example) loop through a bunch of Destructible objects and assign their Assigned Parents at runtime.

     
  10. fssdev

    fssdev

    Joined:
    Jan 16, 2017
    Posts:
    49
    Awesome. Thanks
     
  11. fssdev

    fssdev

    Joined:
    Jan 16, 2017
    Posts:
    49
    I ran into a small issue I'm hoping I can get some help with.
    I setup a destructible room with walls that will crumble and some of the pillars from your demo project. The item that explodes is set to a blast force of 1000 (big boom).
    The problem is, if the explosion is in the middle of this small room, it only triggers the prefab swap. The blast force is not carried over to the chunks, so the walls and everything will look as if nothing happen until a second force interacts with them.

    The only workaround I can think of at the moment is to immediate set off a second explosion behind the first one so that the chunks have something to react to.

    Is there a built in feature that already addresses this issue?
     
  12. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    191
    Hi fssdev,

    Thanks for reaching out to us. DestroyIt is setup so when you apply Explosive damage to objects that get destroyed, the debris rigidbodies are also affected by the initial blast force. However, there are a couple things that could cause it to appear as if no force is being applied to the debris:
    • Check the mass and size of your debris pieces. If the pieces are huge in relation to other rigidbodies, or if their mass is high, they won't be very affected by normal amounts of force. In this case, you can reduce the mass of your objects relative to their size, or increase the force of the blast until they are affected as desired.
    • Check your blast radius to make sure it's not too small to reach the objects in range. The amount of force applied to objects tapers over distance, but if their hit points are relatively low compared to the blast force, they could still be destroyed although very little force is applied.
    I created a Bomb script you can drop onto an object, and it will automatically explode after a timer goes off. I tried it out on DestroyIt's Mass Destruction scene, by putting it in the middle of the columns. I also turned off CanBeObliterated on the columns so they would not be converted into particle effects from the high damage.

    Here's a video of the results of the script, with default values:


    And here's the script:
    Code (CSharp):
    1. using System.Collections.Generic;
    2. using UnityEngine;
    3.  
    4. namespace DestroyIt
    5. {
    6.     /// <summary>
    7.     /// Put this script on your bomb. It will detonate after the specified number of seconds (bombTimer).
    8.     /// NOTE: Be sure to turn off "CanBeObliterated" on your Destructible objects if you are using a high Blast Force value.
    9.     /// </summary>
    10.     public class Bomb : MonoBehaviour
    11.     {
    12.         public float bombTimer = 3f;
    13.         public float blastRadius = 20f;          // The maximum distance from the point of impact that objects will take damage or get pushed around.
    14.         public float blastForce = 3000f;         // The strength (or force) of the blast.
    15.         [Range(0f, 3f)]
    16.         public float explosionUpwardPush = .75f; // The amount of upward "push" explosions have. Higher numbers make debris fly up in the air, but can get unrealistic.
    17.         public GameObject explosionPrefab;       // The particle effect to play when the bomb goes off.
    18.    
    19.         private void Start()
    20.         {
    21.             Invoke("Explode", bombTimer);
    22.         }
    23.  
    24.         public void Explode()
    25.         {
    26.             ExplosiveDamage explosion = new ExplosiveDamage() { Position = transform.position, BlastForce = blastForce, Radius = blastRadius, UpwardModifier = explosionUpwardPush };
    27.             Collider[] objectsInRange = Physics.OverlapSphere(transform.position, blastRadius);
    28.             List<Destructible> destObjs = new List<Destructible>();
    29.        
    30.             // Play explosion particle effect.
    31.             ObjectPool.Instance.Spawn(explosionPrefab, transform.position, transform.rotation);
    32.  
    33.             // Hide the bomb object
    34.             gameObject.SetActive(false);
    35.        
    36.             // Apply force and damage to colliders and rigidbodies in range of the explosion
    37.             foreach (Collider col in objectsInRange)
    38.             {
    39.                 // Ignore terrain colliders
    40.                 if (col is TerrainCollider)
    41.                     continue;
    42.  
    43.                 // Ignore self (the bomb)
    44.                 if (col == GetComponent<Collider>())
    45.                     continue;
    46.  
    47.                 // Apply explosive force if a rigidbody could be found on this object
    48.                 Rigidbody rbody = col.attachedRigidbody;
    49.                 if (rbody != null && !rbody.isKinematic)
    50.                     rbody.AddExplosionForce(blastForce, transform.position, blastRadius, explosionUpwardPush);
    51.  
    52.                 if (rbody == null)
    53.                     continue;
    54.            
    55.                 // If it's a Destructible object, apply damage to it based on proximity to the blast
    56.                 Destructible destObj = rbody.gameObject.GetComponent<Destructible>();
    57.                 if (destObj != null && !destObjs.Contains(destObj))
    58.                     destObjs.Add(destObj);
    59.             }
    60.        
    61.             // Apply damage to destructible objects
    62.             foreach(Destructible obj in destObjs)
    63.             {
    64.                 float proximity = (transform.position - obj.transform.position).magnitude;
    65.                 float effectAmount = 1 - (proximity / blastRadius);
    66.  
    67.                 if (effectAmount > 0f)
    68.                     obj.ApplyDamage(explosion.AdjustEffect(effectAmount));
    69.             }
    70.         }
    71.     }
    72. }
    I hope that helps. Please let us know if you still have issues with it.
     
  13. fssdev

    fssdev

    Joined:
    Jan 16, 2017
    Posts:
    49
    That's odd. No matter what the mass, blast force, or radius is set to, I'm not getting the same results you are. My destructibles switch prefabs, but that's as far is it goes. I'm using the same code and models you are, but not getting the same results.
     
    zangad likes this.
  14. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    191
    Yes, that's strange. I thought there might be some difference in the version of DestroyIt I'm working on (our next release) and the version that's currently on the Asset Store that might make it work for me and not for you. However, I just created a new project, downloaded DestroyIt from the Asset Store and imported it, and copied the Bomb code to a new script, attached it to my bomb primitive, and it's working exactly as in the video I posted.

    So that makes me wonder if there is a difference in the versions of Unity we're using. I'm using Unity 5.6.1f1. What version are you using? If you're using a different version, I wonder if there were some physics changes somewhere along the way?

    It looks like the latest version is Unity 2017.1.0, released a few days ago. I'll download the new version and do some testing/research to make sure everything still works with that release using a new project. Also, feel free to send us a link to your project - I can take a look to see if I notice something.
     
  15. GWStudio

    GWStudio

    Joined:
    Sep 27, 2016
    Posts:
    97
    Can u do a tutorial about RFPS integration please...
     
  16. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    191
    fssdev,

    Just to follow up on this - I've created a new project and tried the bomb script out on both Unity 5.6.2 and Unity 2017.1.0, and it functions for me the same as in the video I posted.

    So at this point, you might check your project settings to see if anything is significantly different from the default settings, especially with the physics settings in the PhysicsManager. For example, I turned off "Auto Simulation" in Unity 2017.1.0, and when the bomb went off, no debris moved (I assume because physics simulation is then disabled). So it might be worth resetting your Physics settings.

    And if you haven't already done so, be sure to create a fresh new project and try it out, to eliminate any issues/settings with your current project.
     
  17. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    191
    A question came up on one of our YouTube videos about whether DestroyIt would work with Invector's Third Person Controller - Shooter Template asset. This asset is similar to their Melee Template asset, but has a few significant differences.

    For anyone wanting to use DestroyIt with Invector's TPC - Shooter Template, here are the steps:

    NOTE: These instructions are for an older version of Invector's TPC Shooter Template asset. Please see the updated instructions for version 1.3.
    1. Import DestroyIt into your Invector's TPC - Shooter Template project.
    2. Click Window => DestroyIt => Setup Minimal.
    3. Import the DestroyIt Scripts for Invector TPC Shooter package.
    4. Drag a DestroyIt Destructible prefab into the scene (example: \DestroyIt\Demos (safe to delete)\Prefabs\Destructible Objects\Pristine\Column.prefab).
    5. Add the vDestructible script to the Destructible object.
    6. Comment out the following 2 lines from the DestroyIt\Scripts\Managers\DestructionManager.cs file (reason: TPC Shooter Template ignores objects outside the Default layer):

    7. (Optional) Assign a destroyed prefab to the column (example: \DestroyIt\Demos (safe to delete)\Prefabs\Destructible Objects\Destroyed\Column Marble+Int DEST.prefab).
    8. (Optional) Assign material replacements for the destroyed prefab:

    9. (Optional) Assign the "Concrete" tag to each of the Column's child colliders.
    10. (Optional) Assign the "Concrete" tag to each of the debris pieces' colliders.
    11. (Optional) Increase the rigidbody mass of the Destructible object and Destroyed Prefab debris pieces (I found that 10 for the column and 2 for the debris pieces worked well).
    Video of the results:

     
    Last edited: Jan 12, 2019
    julianr likes this.
  18. GWStudio

    GWStudio

    Joined:
    Sep 27, 2016
    Posts:
    97
    I have Realistic fps and i use your destruction system but when i hit the object with the player the object destroyed .. I just want the bullet to affect the object .. Any idea
     
    zangad likes this.
  19. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    172
    aymn, can you send us your project?
     
  20. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    172
    The 1.6 update to DestroyIt will be submitted this week. Here's the changelog.

    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.
     
    Inspeinre and julianr like this.
  21. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    191
    Hi aymn,

    I think I see the issue you're referring to. When I put the Destructible script on a wooden crate in the Realistic FPS Prefab Sandbox scene and run into it at full speed, it is destroyed. The reason this is happening is because the Player controller in Realistic FPS has a rigidbody on it, and DestroyIt objects are by default affected by collisions with other rigidbodies.

    You can solve this two ways, depending on the desired effect. The easiest way is to increase the magnitude of ignored collisions on the Destructible script. The default is 2, but I found that by increasing it to 20 I was unable to destroy the crate by running into it.



    The downside to this method is destructible objects will ignore ALL collisions under 20 magnitude, which means that a tree falling on the crate or knocking it around violently will probably still destroy it, but smaller collisions will be ignored. This may be the desired effect for your game, though, and if so, it should work well. You could even increase it higher to ignore collisions of practically any magnitude.

    The second way is to make DestroyIt ignore all collisions from objects with the "Player" tag. Since the Realistic FPS Prefab controller is tagged as "Player", you can add this line of code to the \DestroyIt\Scripts\Behaviors\Destructible.cs script:



    Code:
    Code (CSharp):
    1. if (collision.contacts[0].otherCollider.gameObject.layer == LayerMask.NameToLayer("Player")) return;
    With this method, you won't need to change any of your Destructible objects' Ignore Collisions settings. Destructible objects will completely ignore any collisions with the Player rigidbody. However, the player can still run into objects and knock them around violently, causing them to take damage when they collide with other rigidbodies or the Terrain. If you don't want objects to get knocked around at all, you can just set IsKinematic to True on your Destructible objects' rigidbodies and they will never move.

    If this doesn't solve your issue, please send us a link to your project as DeadlyAccurate posted above, and we will take a look.
     
    julianr likes this.
  22. Silvermurk

    Silvermurk

    Joined:
    Apr 29, 2016
    Posts:
    111
    Good day, haveing trouble integrateing this with TPC:
    I`m trying to make part of character into a destructable object.
    And some component in TPC camera system prevents material change on object.
    If i disable the TPC main camera - it wotks fine:)
    Any help, please?
     
  23. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    172
    I'm not sure I understand what it is you're trying to do. Can you send us your project?
     
  24. Silvermurk

    Silvermurk

    Joined:
    Apr 29, 2016
    Posts:
    111
    Sending It might be difficult because of alot of assets included and integrated to each other).
    Will try to explain:
    I have a ThirdPersonController and DestroyIt in same project.
    I made a character that uses ProgDamage material for it`s material.
    All works fine - it recives damage and gets cracks shown on material.
    If i make this character a Player of TPC camera system (cameracontroller).- it stops showing emission texture and looks "healthy" with any amount of damage sustained on Destructible component`s health.
    Basicly something in TPC`s camera scripts prevents DestroyIt from showing damage textures on an object, if that object is a Player of CameraController.
    We failed to diagnose why on the Opsive side of this problem, so now need to try from your side:)
    On screenshow below we see 2 copies of same prefab.
    Both have 1 health out of 50 on Destructible.
    Right one is set to Player property of TPC CameraController component.
    Left one is exact same prefab with exactly same scripts but is not set as CameraController Player.
    Questions is - why one on the right is not showing damage from Destroyit?
    Thanks)
    Clipboard01.jpg
     
    Last edited: Aug 16, 2017
  25. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    191
    Hi Silvermurk,

    I tried to reproduce the issue, but haven't had any luck on my end. I'm not sure if I fully understand the steps, and there could be many variables at play here. Still, I took a shot at trying to get it to fail with the TPC Controller attached to a destructible object and assigned as the player. Here's the video of my steps, and the results:

    (Note: I'm using the TPC Shooter asset located here: https://www.assetstore.unity3d.com/en/#!/content/84583 . Is this the same one you're using?)



    I just assigned the Third Person Controller script to the destructible column in the scene. Then I assigned the Player layer and Player tag to the object, just in case that might be causing an issue, but it doesn't seem to. Also, I don't understand what you mean by making it a "Player of the Camera system" - do you mean assigning it as the Target of the vThirdPersonCamera in the scene? Because I tried that and it didn't cause it to fail, either. Or is there a specific camera component you're assigning to the object?

    If you can take a look at the video and give us more details on the steps you're using to reproduce, I'll revise my steps and try again. Or you can make a video of your process, and I'll try to recreate it on my end from that. Or to expand on what DeadlyAccurate mentioned, if you can export even part of your project that illustrates the issue as an asset package and upload it so I can import and see the issue, that would help.
     
  26. Silvermurk

    Silvermurk

    Joined:
    Apr 29, 2016
    Posts:
    111
    Watched video, thanks for time and effort makeing it:)
    Fist thing to notice - i`m not useing templates for my games, so ThirdPersonController i meant is this one :
    https://www.assetstore.unity3d.com/en/#!/content/27438
    I didn`t modify any CameraController components there, just in case that could be the case)
    I`ll make a quick vid on how that works:

    If it won`t give enough clue on finding this strange bug i`ll export this clean scene with two prefabs and upload it somewhere so you could experiance it first hand:)
     
  27. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    191
    Ah, ok, I didn't catch that you were using Opsive's TPC. I only have an old version of their asset from January (they didn't have any keys to spare), so I will request a new version/key from Opsive so I can try to recreate the issue.
     
  28. Silvermurk

    Silvermurk

    Joined:
    Apr 29, 2016
    Posts:
    111
    We found out how to make it work on TPC forum:
    http://opsive.com/forum/index.php/topic,4907.0.html
    In case link won`t work:
    To everyone who will use DestroyIt with TPC:
    1) In all camera modes disable "Apply Character Fade" checkbox
    2) In DestroyIt script disable "Can be destroyed" and "Can be obliterated" checkboxes
    3) Enjoy nice damage and normal changeing patterns on any TPC mesh
    Thanks to Justin for TPC part and to Zangad and DeadlyAccurate from ModelShark Studio for assisting on DestroyIt part.
     
  29. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    172
    Hey, glad you were able to get it working, and thanks for posting the solution for everyone!
     
  30. serberusno1

    serberusno1

    Joined:
    Jan 28, 2017
    Posts:
    83
    Just wondering if anybody has had this issue- I've set up a big box in my scene to act as a pane of glass I want to break by driving through it. I'm using Edy's Vehicle Physics for my car physics. So it all works fine, the glass breaks when I hit it except that no matter what speed I'm going, the glass stops my car dead in it's tracks before shattering. Obviously this isn't realistic so I'm wondering if there's some kind of setting I can edit to allow my car to drive through almost as if it has actually hit nothing but still break the glass?
     
  31. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    172
    Can you try the solution in this post and let us know if it works?
    https://forum.unity3d.com/threads/r...destruction-system.251622/page-4#post-2290166



    Let us know if you still have problems.
     
  32. serberusno1

    serberusno1

    Joined:
    Jan 28, 2017
    Posts:
    83
    Not sure I'm understanding this correctly, it looks like that section of code is designed to make sure the vehicles velocity doesn't get slammed to zero when it comes in contact with a destructible mesh so why would I comment it out?

    In any case, I commented it out as in the first image and I just ended up getting the errors you see in the second image which prevented me from even entering play mode. The missing camera error looks unrelated too btw.

    I have essentially zero programming knowledge so I might have just made a fool out of myself, apologies if I've misunderstood something
     
  33. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    191
    serberusno1,

    My apologies, here is an image with more explicit instructions on how to comment out the ReapplyImpactForce() method. I've circled in red the changes you need to make. Note that there are two files you'll need to change - DestructionHelper.cs which contains the method, and DestructionManager.cs which calls the method in two places.



    Please let us know if you continue to have issues.
     
  34. serberusno1

    serberusno1

    Joined:
    Jan 28, 2017
    Posts:
    83
    No errors but the problem persists. Hitting the glass stops the car dead
     
  35. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    191
    I think at this point we will need to look at your project to find out what is happening. Can you upload your project to a site like Dropbox/OneDrive/GoogleDrive and send us a link (modelsharkstudio@gmail.com)?
     
  36. serberusno1

    serberusno1

    Joined:
    Jan 28, 2017
    Posts:
    83
    Cool, just sent you a link let me know if you haven't gotten it
     
  37. Ael-KHAN

    Ael-KHAN

    Joined:
    Jan 8, 2013
    Posts:
    12
    Hello,
    I apologize if this question has already been answered, I confess I did not read all the previous pages ;)
    I am looking for an asset for fracturing meshes (runtime is not mandatory, it could be baked) and your solution is one of the 2 best I found until now. Congratulations for your web demo, it looks quite impressive. Is there a possibility for a trial or demo version to ensure it fits our need for our next game before buying it ?
    Your price is quite reasonnable, no problem with that point but our project is on an advanced step and we use a bunch of different custom shaders, custom subsystems interacting each with each other so we need to test every asset deeply to avoid unwanted interaction issues. I already tested the other solution and it fits our needs but honnestly, your asset seems to allow more fun player interactions.
    I am receptive to further discussions for this demo version (dll instead of sources, time-limited or other limitation to allow testing).
    Thanks in advance for your reply.
     
  38. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    172
    We don't have a trial version, but we do offer a refund if you're not satisfied. You just need to email us with your order number.
     
  39. nikorenos

    nikorenos

    Joined:
    Jun 12, 2017
    Posts:
    28
    Hello, can I somehow disable 'D' letter displaying at desctructible objects?
     
  40. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    172
    Sure! In the Gizmos dropdown under the Scene tab, you can either move the "3D Icons" slider all the way to the left, or you can select the arrow next to the Destructible icon and choose None. I prefer doing the former, since it covers all the icons without having to do each one separately, but both work.

     
  41. nikorenos

    nikorenos

    Joined:
    Jun 12, 2017
    Posts:
    28
    Great, thank you :) And how can I display debris for longer time? When I change "Within Seconds", "Update Frequency" parameters in Destruction Manager and in Particle Manager it does not affect debris which disappears after 2-3 seconds.
     
  42. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    172
    Are you talking about the particle effects, like the default large and default small particles that occur when you place the Destructible script on a mesh? If so, you can adjust those particle effect prefabs directly. You'll need to adjust the Start Lifetime of the particles (be sure you look at the child particle effects and not just the parents) and the Pool After scripts.

    Quick example:

    Pull the DefaultSmallParticle prefab into the scene.
    Set its components (Pool After script and Start Lifetime of the Small Pieces) to 10 seconds
    Reapply the prefab.
    Create a cube and add the Destructible script to it.
    Run the scene and blow up the cube.
     
    nikorenos likes this.
  43. nikorenos

    nikorenos

    Joined:
    Jun 12, 2017
    Posts:
    28
    Thanks, this works, but can I apply this to objects which already have Destructible script?
     
  44. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    172
  45. nikorenos

    nikorenos

    Joined:
    Jun 12, 2017
    Posts:
    28
    I applied prefabs, but I don't understand how this will affect other objects which only have destructible script attached. Small pieces after destroying it disappear very quickly.

    EDIT

    It occured my scene was bugged, on another scene everything works fine, thanks :)
     
    Last edited: Oct 22, 2017
  46. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    172
    Glad you were able to get it to work!
     
  47. spacemarine

    spacemarine

    Joined:
    Mar 28, 2013
    Posts:
    13
    Can this destroy mesh at only near hit point? It looks like this destroys all part of mesh even when small thing hits at outer side.
     
  48. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    172
    DestroyIt replaces an undamaged prefab with a destroyed prefab. It doesn't procedurally break off pieces.
     
    julianr likes this.
  49. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,108
    Experimenting with various explosions using DestroyIt right now - loving this asset - it makes a game with buildings that do not damage, become more realistic. I've added a load of debris items into prefab, added in some force and things go flying all over the place for cinematics. Performance was really good too. Any plans on doing more packs to support this asset? I'm looking to create some buildings that support DestroyIt and sell them in the store at some point.
     
    Last edited: Nov 10, 2017
  50. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    172
    I'm working on another Wasteland Explorer pack, this one for the kitchen.

    If you do make a DestroyIt-Ready pack, be sure to post here so people reading this thread will see it!
     
    julianr likes this.