Need help importing and setting up apex destructible created in PhysX Lab

Hello everyone.

I am having trouble configuring a destructible mesh I created in Nvidia’s PhysX Lab. I used the cutout method to fracture my mesh, and testing it in the PhysX Lab playground gives me the desired results for breaking up the mesh. However, once I import it into UE4, I can’t seem to do anything with it. I set up a blueprint event to fire a radial force actor, and tested to make sure it was firing correctly by placing some rigid bodies around it, and it pushes those correctly. I made a simple destructible in UE4 to test that the radial actor would destroy them, and the one made in UE4 was affected by the radial actor. My imported destructible remains static though.

Ultimately my goal is to have a cannonball smash the the wall, knocking chunks off as it does. I have been searching for a good tutorial on destructibles, but can’t find one that covers bringing an apex actor from PhysX Lab into UE4 and configuring it to work correctly. Ultimately my goal is to have a cannonball smash the destructible wall to pieces (preferably using C++ code rather than blueprints, but that’s a secondary goal), and I would appreciate any help on getting this set up.

After playing with the editor settings a bit more, I have been able to get the destructible to break. However, it breaks all at once (exploding with a huge amount of force sending chunks everywhere), rather than piece by piece. This is without simulating physics. If I turn that option on, the mesh explodes as soon as I hit play.

Hi KnightRaven,

First off, Welcome to the world of destruction with PhysX! It’s a fun place! :smiley:

Just to give you a heads up there are plans for more destruction oriented content to come out in the not too distant future to help explain some of this a little more clearly. It can be difficult at first understanding what settings affect what, but I’ll do my best to help you with this. PhysX Labs and destruction meshes are one of my favorite parts of the editor.

In response to your questions these are my basic setups. These may need to be tweaked and will also depend on how you’re destroying your object as well.

DMSettings1.PNG

Final Result:

All you should need to do is set the support depth to the layer you want it to provide support up to. If you’re using the Fracture Tool in UE4 you can only have one depth layer so you would want to set this to 1. This will provide “support” to any chunks at this level but anything below will not be supported.

If you’re using PhysXLabs and are using multiple depth layers this setting can have much more influence on how things are supported and what destruction depth is supported.

Typically most DMs need a combination of settings to get the proper look and feel. Only the most basic setup is provided from the get-go.

This is expected as well. By default the when you turn on “simulate physics” the “start awake” option is enabled. You’ll want to disable this so that it doesn’t automatically wake up which you may not need. Some of this behavior will also depend on how you’ve set up your DMs settings as well. Using support depths will help correct this behavior.

If you check out this forum post you’ll find some of my sample projects and mini tutorials I’ve started posting that can help. There will be more destruction oriented tutorials I’ll post here over time and if you have any request for setups I can post something here for others as well. Eventually, I’ll get these up on our Wiki tutorials page as well.

Project 2 has a setup using both the yellow ball projectile and the line trace method I use to demonstrate some differences in their setups. Project 3 is looking at some of the Chunk Parameter settings for destruction meshes more closely. This is using the line trace method for applying damage.

Feel free to ask any questions and post suggestions for what you’d like to see for some simple setups. I don’t mind helping. :slight_smile:

If you’re having trouble setting up your DM please post a screen shot of your settings and I’ll offer some feedback. If you post your settings use the eye icon in the top right of the panel to only show modified properties.

Tim

Thanks for the advice! I was able to get my destructible set up and it seems to be working well. I am still having one minor issue though: it doesn’t seem to want to cast shadows. I have the option checked in the properties but no luck with the mesh actually casting a shadow in the game world. Is there other settings I need to look at for this?

By the way, those tutorials are a huge help. Several other questions I had were answered already. Definitely bookmarking that page!

With your DM not casting shadows, I would check the light mobility to make sure that it’s set to stationary or movable. If these are set to either of those mobilities and still no shadows take a look at your Engine Scalability settings and make sure they are at least on Medium for Shadows, otherwise shadows will not be dynamically drawn.

If neither of those worked, is it just this mesh or all meshes that are not casting shadows?

There are a lack for a lot of destruction tutorials out there. Mostly everyone will show their awesome destruction, but no explanation how to set it up. :confused: A lot of my understanding came from A LOT of trial and error. I had a very hard time finding any tutorials that weren’t older ones that are on the NVIDIA site, but those are made in UDK. The majority of those will carry over, but I’ve run into some issues with some settings that I’m trying to narrow down. For the most part they work well enough trying to figure out.

My goal is to make some simple setups and mini-tutorials for others starting in this forums post. When I get a few more up there I will start adding them to our Wiki page. Please feel free to post any ideas or even simple setups. I don’t mind setting them up and making something that can help others as well. :slight_smile:

Excellent! I will go through the settings and see if I can get the shadows on. Unfortunately my computer is suffering overheating problems at the moment so it may be a while until I can do so. Thanks for all the help.

One bit of news regarding the shadows. Honestly, I don’t know how I didn’t notice this before either, but I entered a bug today for meshes created in PXL not casting shadows. Not sure when that will be addressed, but I went back and looked at some of my older meshes created with PXL and sure enough I couldn’t get them to cast shadows for anything. :confused:

If it’s just a bug it shouldn’t effect my development too much. I’m still in an early prototyping phase, so if I can’t get it working right now it’s not too big of a deal. I’ll keep an eye on future updates to see if it is addressed and continue working without shadows in the mean time.