Swap static mesh with destructible mesh

ok i created a destructible mesh tree and then i tried to foliage it but it didnt work so then i tried multiplying it so i could fill the map with trees but then it started lagging and i realized destructible meshes have no LODs

i think i saw someone saying about swapping the static with destructibles but i dont know how to do that im still a beginner XD
could someone explain it with steps or something easy to follow?

It’s a little bit old but the same system applys

ok so i followed the tutorial video (which was a little hard because it was different from what i wanted) and i made a blueprint that turns static trees to destructible in a sphere area collision but the problem is that whenever it touches a tree from the forest it starts randomly picking any tree one by one from the whole forest and turning them into destructible until eventually they all turn destructible unless i move the area away its like if when it touches one tree it touches all of them i dont know why it happens i only want it to transform the one it touches not all of them

that’s a big loop :smiley:
here’s how I do it

it has a big loop because it resembles INFINITY!!! also because i want it to constantly check for static meshes (if i dont put a delay my computer freezes lol)
anyways isnt that the blueprint from the video tutorial dude in which you press a button and the tree falls?
what i want is to make the trees destructible when the character gets near and if they were not destroyed turn back to static when the character gets far
thats why you see sphere collision area it has a radius of 4000 and it follows my character and what it is supposed to do is turn every static tree it touches to destructible but for some reason as soon as it touches one tree it detects the whole foliage as one so it starts transforming all of them

yeah infinite loops are bad :smiley: normally the editor will warn you, but because you have the delay node it won’t. instead of having a radius of trees transformed into destructible’s in case you decide to destroy a few, it would be much better to only destroy the ones you want to when you want to. whats the use case scenario here, are you chopping them down? does your player have some sort of force power to blast trees in an AOE?

say you want to destroy some trees, and you want it to be an AOE attack like a spell or grenade, you could do a sphere trace instead of the line trace, swap out the destructible’s for any trees hit then do an impulse to knock them all apart.

if its just one at a time then line trace would work well.
if you have say a mech that’s stomping through the forest (or a Trex!) same thing applies, you could do a sphere collision a little bit bigger than the player, and use overlap events to trigger the swap and then the character would destroy the tree just by hitting it.

YES EXACTLY thats what i want if my character is a robot or a monster or a dinosaur or if im driving a tank i want it to destroy the trees it touches and thats what im trying to do in my blueprint by adding a sphere collision named AREA which will switch them when overlapped but the problem is that when it touches one it selects them all

try doing this
make a small forest with foliage tool
click on only one tree
the whole forest will be selected (highlighted in yellow)

i think this is the problem with my blueprint its selecting the whole forest but i dont know how to make it only select a single tree

is it my blueprint not specifying which mesh from the foliage to change or is it some settings in my foliage tool

I’m enabling the plugin now, will have a go at this once iv reloaded

Edit: Pretty sure I have it all working now, I will upload a quick vid in a few mins. have a toggle for destruction and when it’s on and you hit a tree it breaks, turn it off and you collide.

Edit:2 now have it on sprint, so if I walk into a tree it does nothing and if I sprint into it gets nuked

Edit:3 ue4 instance replacement - YouTube

still tweaking bp

here’s my final BP
also, looking back over your BP you’re missing instance index, that along with the component tells the engine that 1: you want type A of tree and 2: you want number 680(whatever number you hit) instance of type A

Thanks it worked only thing i had to add break hit result because i wasnt getting the options in sphere trace by channel

now about my BP i added the index but now all they do is spawn in one same location and it wont delete the static trees

with the break hit result, you can right-click on the out hit pin and break it, you can do that for a lot of nodes and it keeps it cleaner imo. I don’t think body index from on overlap is the same as hit item on line/sphere trace so yeah probs won’t work that way.

i wanted to change nearby trees in case of using a ranged attack like a rocket launcher without having to add a hit event that turns static to destructible to every single attack so
NOW I FINALLY GOT IT WORKING changed hit event with overlap area and used character location and now it changes all nearby trees to destructible :slight_smile: thanks
now i wonder how to change them back… is there a way to make a collision sphere with a min and max lets say collision starts at 3000 radius and ends at 4000? like a hollow sphere