I have been more or less playing around with destructible meshes for the past few days, and have created my own assets in 3ds Max. My goal is to have a few destructible assets, with which I can create a building that I can then destroy. I used Nvidia’s PhysX Lab (1.3) to create my destructibles.
The problem I have is, that whenever I try destroying something using the FPS Blueprint projectile (modified to explode on impact) a few pieces break off the mesh, the mesh then wakes up and just falls over, and I can’t cause any further damage to it, as the projectiles just bounce off. I can also run into the mesh before it is hit by a projectile, and cause it to fall over easily. I have tried meshes with 2 depths (shown in the example below) and 3 depths, with the same results.
A few screenshots to give an idea of what is happening, as well as the settings I used:
First off, you need to set the default impact damage depth. Since it was set to -1 it wasn’t reacting to any impacts even though you had set a impact damage of 7. I left mine at 1 though.
The main thing you want to adjust here and tweak to your benefit is the damage value.
As a note, I did not use the projectile with the yellow ball. I used a line trace and added an impulse. Because of this there may be some values that need to be adjusted in the damage and impact sections, but this should be enough to get you started.
Sorry for the late answer. I hope it’s not to late to get some more help!
The problem of the wall falling over after the first hit was fixed by disabling Simulate Physics and changing the colission preset on the mesh to Destructible.
So, my destructible meshes almost work now! I’m using these settings.
I have also created a simple line trace weapon thanks to a couple different tutorials I found on the forums and Youtube. The weapon applies 500000 radial damage on a very small radius of 25. I want to be able to “chip away” at the mesh, and it seems to be working quite nicely so far.
The problems that are still left right now are, that I can damage the mesh heavily just by running into it. It was suggested to me that a high Impact Resistance may fix that, but that does nothing. Also, whenever I cause a lot of destruction quickly, all the fractured pieces disappear and shooting the mesh simply removes more and more of the destructible, causing no new fractured pieces to fall off.
Do you have an idea on what I could do to fix those things? Again, any help is highly appreciated!
I setup a similarly styled wall to test with in my test level. If you don’t want the force of the player capsule damaging the wall you’ll want to set Impact Damage to 0. There is no need for this to be enabled if you’re only destroying it with the guns. If absolutely need it there is some magic that can probably be setup through overlap events to disable it for the player character but I’ve not toyed around with that so It’d probably take a me a bit to figure out and get right.
Some other notes about your settings. You have Asset Defined Support enabled. Did you set any chunks to never be destroyed? If not, I wouldn’t worry about checking this box. Also, the accumulate damage. You have set the damage threshold to 1000 but have not set a damage cap. Without this there isn’t any different between setting the damage threshold to 1 or 1000000000. If you’re going to use 1000 as the threshold set the cap anywhere in-between 1 and 1000. This will accumulate damage since the flag for that is set and once it hits that damage cap it will start to fracture.
For the other issue with pieces disappearing I’ll have to look into this a bit more sometime this week when I can. I believe there is a cap of 2000 fracture pieces in a scene but I’ve not tested this. This is just something I think I remember someone saying, but I’ll definitely test and see what I find.
Let me know how those settings above work for you.
static TAutoConsoleVariable
CVarAPEXSortDynamicChunksByBenefit(
TEXT(“p.bAPEXSortDynamicChunksByBenefit”),
1, TEXT(“True if APEX should sort
dynamic chunks by benefit.”),
ECVF_Default);
Thanks for the quick answer, I’m a bit under deadline pressure so this is very helpful!
If you don’t want the force of the player capsule damaging the wall you’ll want to set Impact Damage to 0.
Unfortunately, I have tried all of sorts of settings and nothing seems to work, as does an Impact Damage of 0. I can still completely demolish everything by simply touching it.
Did you set any chunks to never be destroyed?
Yes, I do want the floor bits to stay intact and have set those to Do Not Damage, although this does not seem to work for me. It gets damaged anyway.
Sorry, I forgot for a moment that some things changed with 4.6 with the layout of the damage parameters. Change the Default Impact Damage Depth to -1 to stop any impact damage from the player or any other objects.
I also tested the do not damage for chunks but couldn’t get that to work. This may have been a bug that was resolved in 4.6 because I have that working flawlessly. There have been some changes especially in the chunk parameters that could have resolved that issue. I know that doesn’t really help if you’re on 4.5 right now though.
I read that theres a couple of pretty important things related to destructible meshes getting fixed in 4.6, some of which I could really use now.
Is there a release date or a month you’re aiming for with 4.6?
Back to problem solving:
Weirdly enough, changing the Default Impact Damage Depth to -1 still lets me run into the mesh and demolish it. Like I said, I tried all sorts of settings, and nothing I do seems the way the mesh reacts to me touching it with the player capsule.
Even though I’m getting closer to having everything work as I want to (thanks to you!), I seem to be encountering a new problem now. Out of all the destrutible meshes I have in my scene, only the first one I spawned can be destroyed by shooting at it (and running into it). All the others can only be damaged by running into them. I don’t really understand why that is happening. They all have the same settings, and it doesn’t matter if I duplicate them from the first mesh by holding alt, or spawning a new one via the content browser and giving it the same settings as the first mesh in the editor. Interestingly, It worked before. I don’t really know what’s causing this.
As a test can you either create a DM from your original static mesh for the wall or a basic box. Once you’ve done that just fracture the DM and save. Place this DM in your scene and with the default damage parameters you should be able to destroy it with the line trace weapon you have but you won’t be able to walk into it and break it. See if this works and compare impact settings on your current DMs that are fracturing when you walk into them.
I found out that it is was caused by having Extended Structures enabled. Without it, I can damage everything. Although having it disabled causes them to “unhinge” and jitter into each other. Anything I could do here?
I also found out what the cause was for the player being able to destroy the mesh by running into it. All my objects still had Simulation Generates Hit Events enabled, which is not needed anymore, since I now use line trace.
I just realized I completely overlooked your first question from yesterday regarding 4.6. Apologies for missing that.
4.6 will be released very soon. I can’t specify an exact date as things may change by a day or two here and there. This has happened before, but it will be soon enough. We do have the 4.6 preview available via the launcher. This will resolve the issue with the Chunk Parameters not functioning properly with 4.5 and prior releases.
Okay, that sounds great! Let’s hope it gets released before my deadline then.
The only problem left for me now, is the Extended Structures option making it so only the very first mesh I spawned is destructible.
Without it, the meshes start waking up and jittering weirdly. Any idea why I can’t use Extended Structures here, or is there a way to get it working?
That also appears to be a bug. I’ve gone ahead and submitted that one (UE-6062). That doesn’t look it will be fixed in 4.6 when it releases unless it ends up getting put into a 4.6.1 hotfix.
I imagine the jitters you’re seeing is due to the mesh trying to fall once hit but not being able to since it’s collision bounds are in contact with another mesh.
Something to work around here be to use World Support. Any static mesh that the Dm is connected or touching will act as support for the mesh not allowing that part of it to fall unless it can be damaged and has been separated from the rest.
Thanks for catching that form extended structures bug!
Aww, that’s a shame. I was hoping I did something wrong, so it could be easily fixed. Oh well.
World support would work, if there were any static meshes connected to it. But all I have connected is other destructible meshes.
Either way, everything seems to be working now and it works quite well, with the exception of Form Extended Structures.
You’ve been incredibly helpful and this thread can be marked as resolved!
Since you don’t have any static meshes up there you could actually do some trickery to it working properly.
Create a static mesh that would span that entire length of the hallway. It doesn’t have to be very thick or anything more than just a box. You could do this with a BSP that you convert to static mesh as well. In the SM details panel set the flag for “hidden in game” to true/checked. This way you would have a SM that the your top wall pieces could be supported by. Since there wouldn’t be any real geometry there to hold it in the state it’s in now. i would make the SM for world support narrow and so that if you destroy parts of the DM it’s not just left looking like it’s hanging in mid-air doing nothing. (I hope that’s not too confusing). I’ve not tested this but that may be a good possibility and it should still provide the world support even though it’s not visible during gameplay.
Thanks for re-titling. I think that fits better. Also, thank you for recommending this thread to others on the forums. There is a lot of information in here that could be helpful for others!
It works like a charm! These meshes act as support like you said. They need a collision model though, and this could cause some piece to glitch out, but that’s not the case here at least. Either way its better than having whole meshes dislodge and freak out.
Awesome! That actually looks more natural by having supports in the DM!
I know you’re on a deadline, so when you get done with everything, if you feel like sharing a vid on your final results I’d be curious how everything turned out. Shoot me a message on the forums sometime.