Destructible Mesh (Any Mesh) - Unreal Engine 4 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys welcome back to another home wrenching 4 tutorial today and let me show you how to create a destructible mesh inside your game then when you shoot it the mesh breaks or explodes or however you want and you use it on any static mesh you like doesn't have to be a set one that you have to downloading me any you just repeat the steps and then maybe change a few things for different meshes now I'm going to using the default cube that comes with Unreal Engine so if you defined this you just click on the cube that's already in and then click on this little magnifying glass on the right here and the static mesh that would take you to it or if you don't have any in your gameplay used to only use this go to content geometry meshes and then keep there know what we want to do from this is create your destructible mesh so to do that we're going to add it off at the top left up here then down to plugins and we're going to search for Apex destruction and just tick enabled like this and then we have to restart our engine so I've just restarted mine and then when you come back in Shantae to healing you just close this right click on the cube so it's one in underscore cube or whatever you want whatever mess you want and right click and go to the top and create your structural mesh like so it's that easy and it should open up a new window with that static mesh in like so may take a few seconds to load but there you go and then once we're here we're gonna want to change the damage threshold which is the amount of damage you need to break the cube or the object so I'm gonna set mine to 25,000 I think quite good one and the damage spread is how far over the object you want it to go so if you want it to break the whole thing or just where you shoot it so 0.1 will be more fracture point for example on a hard surface like wood or concrete or something it will just break where you shoot it or if you want to break the whole object like glass wood when you shoot it as much as all of it so I'm just going to set it to all of it just to show you so I said it's a 1 for the moment and then we also want to enable impact damage which means when something collides with a subject it will cause damage and the impact damage I'm gonna set to 1 as well in the rest will leave as it is then off debris really want to change their lifetime so that it will despawn afterwards so there it doesn't just create a load of meshes in your game which will affect performance and this is in seconds so the minimum I'm gonna have as 5 seconds a maximum is 15 so anywhere between 5 & 5 fifteen seconds is when it will despawn again I'm gonna leave the others as they are so we're gonna want to go down to flex so click off that and split onto flags like so and we want to take accumulate damage meaning that if the first time you shoot it or damage it doesn't break it it won't remember that damage not reset it back to zero so it basically has a health worth like a player would and then you also want to take a debris timeout meaning that the debris will actually despawn between those times and after this you're gonna scroll down to the hierarchy depth like so and just take enable debris and I'm gonna set its pre depth to one as you see a pre preview depth up here this basically means that the debris will spawn outside of this shell mall on the inside meaning it will explode out and not in and again leave the rest as they are and under the fresh settings below all of this we've got the Voronoi or the Voronoi I hope you pronounce it I'm not sure I'll leave is 25 and in the general you can set a random seed to any number you want I'm just gonna set mine to 5 and this just means that it will explode in a random way different each time so you said it's a 5 every different to 4 or 2 8 or 10 whatever so this is a table to pick any number you want doesn't matter I was like minus 5 it's just so that each one explodes differently and then to test this we're gonna set the explode amount think I'm gonna set mine to just a 1 to show you any hit fracture mesh and you can see it explodes like that I think I'm just gonna set the explode man down a little bit it's a point 5 maybe back smash you can see how it looks like that obviously the bigger the exploded month the bigger that goes out I don't need it to be that high so I'll set it to 0.5 like so then we're gonna save this and close it down and we're gonna want to drag in our destructible mesh from the content browser down here so make sure it's underscored diem at the end for destructible mesh and just drag it into our level I'm just gonna move it over here a bit and make sure it's flush to the ground so that's like it's sitting in the ground like so and then with it selected it's going to the details panel on the right over here and scroll down to physics I'm gonna want to simulate physics and have gravity enabled like so there's still on the physics side over here we're gonna click there's a little arrow here too advanced to give us more options and then we're just gonna scroll back up and uncheck start awake like so meaning that gravity won't be enabled it as soon as we start the game you have to interact with it first before the physics is enabled and then so we can shoot it with the first bus and bullet projectile we're gonna go and open up blueprint so going content first-person VP blueprints and open up first bus and projectile like so and then we're gonna go down here and just right-click and add force at location if you want to be using the force rather than the impulse and you get collision component doesn't matter too much because we're just gonna get rid of that reference plug that to true there and plug that in to destroy actor and then off the get velocity will plug that into the force in the gaps location obviously in the location like so hit compile value and also set the target as the other component like so and then hit compile and there we are now we can close this hit play and if we go up to the box and walk into it and eventually it will explode or if we shoot it it will also explode obviously it's got a lot of damage so if - sure quite a bit but it did explode eventually obviously you can change how much you need to do this so if we just find this again and open up you can change the amount of damage it has so set it down to ten thousand like so let's save here play shift again don't get your shoot as much I can also just increase exploding mind a bit like so so it's down to 5,000 save and then play again you see you get different clients no see you just play around list for however you like just get it perfect for you yeah the damage spreads down you just play around with this to get the exact effect that you want to have like so and it should also work with gravity so if we just put it up a bit like so and then how to start a wake play you see that it does break it lacked a little bit as it broke it came up I think that's just because of how many that's just gonna explode mine I've got on it and if we hit play have it break and we can wait for it to de-spawn we'll see that it will despawn between 5 and 15 seconds after it broke meaning that if you have multiple of these there won't be too many static meshes like you know your game as you saw there they just despawn so I think that'd be a first video I'm quite so everything likes to do we have a destructible mesh which you can break and explode like so and again you just change the effects for how you want it to look and if you change the blueprint on the bullet projectile back to the impulse you will see that it acts slightly differently than the force move that back they can pile play also just move this back down like so you see that it flies off into the wall and then explodes which is why we have the force instead of impulse but that'd be it for this video so thank you for watching I hope you trying to help them hope you enjoyed if you did make sure to LIKE subscribe down below and thank you for watching I'll see in the next one you
Info
Channel: Matt Aspland
Views: 103,751
Rating: undefined out of 5
Keywords: ue4, unreal engine 4, unreal engine, tutorial, ue4 tutorial, unreal engine 4 tutorial, how to make a game, how to, 3d modelling, blender, unity, games design, graphic designer, mesh, static mesh, meshes, destructable, destructible, random, randomly, seed, apex, shoot, shooting, shot, any, how, to, plugins, plug ins, plugin, plug-in, plug-ins, walk, in, ue5, unreal engine 5
Id: 4MaIhIBZq_A
Channel Id: undefined
Length: 7min 57sec (477 seconds)
Published: Wed May 27 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.