Hello there,
i’m working to create a destructible tree, i was thinking to create a static mesh and a destructible version of that ; so if the player hit the tree (static mesh), this one will change in destructible, and activating physic will come down.
i need some help, it’s possible to do it? in case it’s yes or not, how it’s possible to do it?
Hi ,
This is possible. A destructible is simple a static mesh that has been fractured using Nvidia’s PhysX Lab standalone/dcc plugin for Max/Maya or using UE4’s Destructible Mesh tool.
The difficult part in doing a tree will be to work within the limitations of the system that is used to fracture your tree mesh and using the proper settings to make it look like a convincing tree being destroyed.
Caveats to using destructible meshes:
- Must be a single contiguous mesh. This mean NO holes in the geometry otherwise you’ll have errors.
- N-sided polygons are bad. Only use quad or triangulated meshes.
- planar meshes (single plane) are not going to work well.
- Extremely long thin triangles will most likely result in holes in the mesh.
Also check out this post that rehashes some of this information on the AnswerHub: Solid objects losing faces during destructible mesh - Asset Creation - Epic Developer Community Forums
Personally, if I were going to do a tree I would start by looking at using the custom destruction setting in UE4 (Import FBX Chunks), and fracturing my tree the way I would like in a modeling application. I would import the the broken tree asset in using this method. I’ve got a simple tutorial here on the forums: [TUTORIALS] Photons Be Free: Mini-tutorials and other curiosities - Community & Industry Discussion - Epic Developer Community Forums
I’ve not tried this with a tree type asset before, but I would imagine you would have a better time using this method than just using the built in fracture algorithm.
Thank you Tim,
actually we have only one question, how can we place them on map using foliage? just because it’s impossible to place a blueprint using this one.
Destructibles and Blueprints cannot be placed using the foliage tool. Only static meshes at the moment.
These will need to be placed by hand or you can use a Blueprint to place your DMs possibly. May be other issues associate with this as I’ve not done this myself, but it’s a possibility.
This tutorial from our Unreal Engine YouTube channel should help: - YouTube
Will we no longer benefit from the batching and performance enhancements that the foliage tool gives us if we hand place all the destructible trees instead? And it will perform way worse? If its like a ton of trees because I wanted to have my whole forest’s foliage destructible
There is no batching with the DMs like it is by placing the instanced foliage.
If you’re going to use a lot of DM’s you may hit some performance issues. This is common with a lot of destructible objects in the scene, especially if they have been fractured and have multiple chunks left in the scene. There are solutions, but not without a lot of work ahead and possibly much more than can be suggested in a simple post about optimization, using blueprints to spawn in chunks rather than using the chunks in the DM, and so on.
Some things that will help in your scene overall with a lot of DMs:
-
Enable Async Scene in the Project Settings > Physics > Async Scene. Making sure that DMs are in the async scene can help, especially with a lot of them.
-
DM settings to be mindful of:
- Debris Timeout flag with Debris Lifetime min/max values (removes chunks from the scene after a set time)
- Use Particle emitter for things like leaves and splinters for added effect. Do not expect this to be available as part of the DM fracture.
- Crumble smallest chunks flag and chunk parameter can be helpful to selectively get rid of smaller piecses that are not needed when they recieve enoguh force to be destroyed.
- Use valid bounds and/or debris max separation to get rid of chunks that are far away from the origin of the DM.
These settings can help you optimize your DMs more carefully. Obviously, other settings will be needed to get results that look and act like a tree being destroyed such as World Support, Support Depth, A lot of the settings in the Damage tab.
Again, this is just a broad overview of where I would start. I’ve not personally done this setup, so it may take a bunch of prototyping and optimization to get just right.
Some of the things done in this post on AnswerHub may be useful to get better results as well. Destructibles fractures are disappearing and stopping being created - World Creation - Epic Developer Community Forums
Look at the bottom where John talks about switching out the chunks with an instanced mesh. This is kind of the idea I wanted to pass along for using lot of DMs in your scene and getting better performance.