Unreal Engine 5.3 - Introduction To Chaos Destruction & Caching

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video we'll take a look at how to use chaos destruction Onre engine 5.3 we'll go over how to prefracture and set up objects for Destruction how to have material specifically for the insides of those fractured objects and finally how to simulate and cash out destruction so we'll start off with a brand new scene and we'll go up here to edit plugins and make sure that you have the chaos Niagra plug-in loaded once you're sure that checked on we can start fracturing objects in our scene so I'm just going to create a sphere here but you can pretty much select any object in your scene and once you have it selected we can go up here to our selection mode and change it to fracture we're going to have to create a geometry collection that will hold the pieces for this object and prefracture it and to do that we're going to click on this generate up here and create a new geometry collection asset so we can just click cck new and it's going to open up this window asking us where do we want to save that geometry collection of our object that will be fractured and I'll save it into this chaos destruction folder that I have and the default name here seems okay so I'll click create geometry collection once I have that created we'll see this checkerboard pattern over our object now we can start fracturing it and there's a bunch of different ways you can fracture it you can fracture it by angling a plane and cutting you can fracture with a brick pattern a radial pattern but in this case I'm just going to use a uniform pattern and then set here how many pieces I want to fracture it into 12 seems okay so I'm going to leave it at 12 but you can change it to any number that you want it's also going to ask you what material do you want to have for the internal pieces so right now it just set to automatic but you can click on this drop down and if there's multiple materials assigned to this object you could choose which one will be used for the inside faces when it breaks in this case I don't have anything set up for that so I might want to set that up before I actually fracture this object now this sphere here has two different materials uh on it it has the basic shape material and the world grid material because it is just the default sphere so what I could do is I could end up using one of those for the destruction pieces when they break open which one of these materials will it use so in this case I'm just going to choose the second slot which is right now the world grid material but I'll end up changing that later on but as long as you choose which material you want inside assigned to the inside faces that's the main thing that you'll have to do here I'll select that material slot one and after I've done that if I'm not happy with how this is fracturing I could change a random seed just to give it a totally different pattern of fracture and if everything looks good then I could click fracture now there are other options here for if you want grout or sections in between uh you have options for amplitude and frequency and point spacing but for now I'm just going to leave that all as default and just click fracture once you've clicked fracture you can preview the pieces that it will break into by going up here and upping this explode amount and you can see how that object starts to separate into the pieces that I'm going to fracture it into so if that all looks good and I'm happy with that I can leave that explode amount at zero and I'll see over here on the right hand side a section called histogram with kind of all these options here where I can show different clusters um show or sort values and see kind of all these sections and you can click on these sections and see where those pieces belong to and you'll see that they have these kind of bars that are different lengths so what these bars show is size so the biggest bar at the top here is everything Al together the second one below it is the second biggest piece and then it goes smaller and smaller into these smaller clusters and the one at the very bottom is the smallest piece on this object so kind of just a useful way to kind of explore the different fractured pieces that you have you can also see down here under outliner settings all the different individual pieces and what they're grouped under so you can have larger pieces that get fractured into smaller pieces and those smaller pieces will be nested under those larger pieces so for example if I were to to go in here and find my biggest piece like this one here right there that's the biggest kind of Chunk that gets fractured if I select that I can see here it's this second chunk and I can go over here and Fracture it a different way I could use a cluster fracture and I can fracture that piece into smaller pieces and once I click fracture you can now see this piece that was fairly big now fractures into much smaller pieces so you can start also adding more detail to individual pieces that are too big or that you want to fracture into more and more sections so that's something that you can kind of do now be a bit careful because if you fracture something into too many sections it might get get pretty slow so you don't want to overdo it the next thing we're going to do is just test this out to make sure it all works so I'm going to go here and I'm going to leave the fracture mode into selection mode I'm going to drag this ball a little bit in the air a bit higher up maybe I'll zoom out a bit so put it up here and on that ball or on that sphere I'm going to go in here to my details Tab and when I select it I'm going to go into physics and turn on simulate physics if it's not already on and then I'll go up here and just go play or click on these three dots and go to simulate and I'll see that ball fall and it doesn't really break a piece broke off but seems pretty strong so if you want to control how weak or how strong your object is for fracturing that's going to be done under this section called GC here and under GC you will find a bunch of options to do with the kind of damage or destruction you'll find some clustering options you'll also find a section called damage which determines how much damage or how much strength each level has and you can see there's three levels zero one and two and these levels kind of correspond to what we saw in that fracture mode here where there's zero that's everything all together and then one is all these other pieces and then two is inside that second piece so different levels of of fracturing and you can also see them down here as well level zero one and two so you can determine how strong each level or cluster is so right now it's fairly strong I'm going to make this really weak I'll make it a th for level zero 500 for level one or actually maybe a little bit stronger, 1500 and then for level two I'll do like 1,800 so I'll make it stronger just so it's takes more Force to break those individual chunks into more pieces and if I click play okay now it starts to break into pieces and some of those chunks stay together so we can start adjusting that and if you make them all super weak like one one and one the whole thing will just shatter like glass once it hits the the ground and kind of every piece just falls apart and doesn't really Stay Together whereas if you make those other levels higher tolerance to falling apart then when it breaks those chunks all stay together now that we have this breaking what about materials so right now I still have the ball that we added the destruction to directly in the scene I'm going to delete it and rrag our geometry collection from our content browser into our scene so it's all stored here and if you drag that in you'll be able to place it wherever you want and that will be our ball with materials on it or your object with materials on it that you could assign here and it will properly have those materials and not show those other colors and again if you set the damage thresholds on that old object and you've deleted it and red dragged this in from your content browser you will have to go here to the GC Tab and reset up your damage thresholds so it's storing them on the individual object so if I were to place three of these spheres into the scene each one could have different damage thresholds if you want to change it for the whole geometry collection that's sitting within our content browser we could also double click on it in our content browser and a window that will pop up will have all of our settings for setting the default damage thresholds for this object so maybe I'll do that first I'll delete what we have in our scene here I'll open it from our content browser I'll go in here and make it quite weak on the first cluster and then may be stronger on the other clusters so that smaller pieces stick together and then I can also set up the materials so when we were fracturing this we set material index one to be the inside faces so if I create two materials just really quickly one of them is going to be maybe gray we'll go in here and just add a very quick constant of gray that will be the ball and then I'll have another material here that will just be a red material for the insides and I'll sign those so gray material for slot zero red material for slot one I'll save this geometry collection drop it back into my scene set up its location so maybe I'll drop it up here make sure that I have physics enabled so it can fall and if I simulate there's our ball and when it falls and breaks it has that red material on the inside faces so now we have our two different materials on that object one for the inside faces one for the outside faces and we can fracture this object now what if we don't want the whole object just to completely fall and break there might be cases where you want certain chunks to stay stuck together so one thing that you can do is go in here to your content browser into the engine folder now if you don't see the engine folder go to settings and make sure that you have turned on show engine content and if you have that you can click on this engine folder and search for anchor and you'll find this fsor anchor field generic and you can drag it into your scene and what it is is a field that you can place around your object like how I'm placing it around half of this sphere and it will hold all those pieces together and make them invulnerable like they won't be able to fracture or fall apart or really even be simulated with anything they'll stick and hold their shape for the pieces within that box and they won't be affected by gravity either now if I'm to click simulate it'll actually still fall and not be affected by that box and the reason for that is you have to connect this geometry collection or this specific geometry collection inside our outline or inside our scene to use that anchor field so I'm going to click on this geometry collection of our sphere here and I'm going to go to where it says GC and under here you'll have a section called initialization field I'm going to add initialization field and then you can select an initialization field and I'll click down on this drop down and select our anchor field and now our anchor field will be used by this geometry collection of this sphere so when I click play now or simulate the sphere stays there in space it doesn't fall because that anchor field is holding it so if I were to have another ball now that doesn't have any sort of Destruction or chaos destruction but it just has physics so there ball will fall and hit this other one and if I select this ball and turn on physic so it can actually properly fall and I click play it will now fall and hit this other ball and you can see that pieces of it break off but it doesn't fall because half of it is still in that anchor field so it will never kind of leave that anchor field even if I were to take this new ball here I'll turn I'll leave simulate physics on but I'll click simulate and I'll I'll grab it um with this transform and I could just smash away pieces of this sphere but the part within that anchor field won't won't ever break or won't ever fall so this way you can kind of control what objects or what parts of an object uh simulate for Destruction and what parts don't now what if you want something precalculated so you have your destruction already set up but have it just trigger at a certain point or maybe if you're doing a short film or something you want your destruction already pre-calculated so it's more predictable of what's going to happen well if I have this ball here and I'm just going to angle it a little bit more offset so we have a bit more of a interesting response uh to that ball when it breaks if I want to re create this distru to be the same every time like right now each time I play it something slightly different is happening so this piece Falls here and those two pieces fall there I play it again a little bit different this time and if I play it again every now and then it's a little bit different so if you want it to be more predictable you can cach it out and to do that we need to go up here to edit plugins and search for chaos caching and make sure you have that plugin enabled if you have that plugin enabled what we can do now is go up here to our add button and add a chaos cash manager and we'll add this item into our outliner called chaos cach manager and you'll have options on it for the cash mode whether it's record or play and you can also set it to static pose to set it to a fixed time within the destruction but what we're going to do is record a simulation or cash it out and then just be able to play it back so it's the same every time now to create a cash we have to have something to store that cash too so we're going to create a chaos cach collection and we can do this by right clicking in the content browser going to physics and creating a chaos cach collection and I'm just going to call it uh maybe chaos collection Cc or chaos cache and then I'll just maybe name it ball breaking and I'll take that collection cache and drop it into my chaos cash manager under the cash collection this is kind of like what you're simulating these pieces too this is almost like your save file or your file that's storing that cache so you could have different caches and play back different ones or pop different ones into here and play them back so right now we're wanting to record a cache so this is going to be our cache file and we're going to set this to record so it's going to record whatever happens to this ball to that cash collection so if I were to simulate now which will start the cach it won't actually save out anything because we have no observed components so you need to add what you're caching you might be caching many objects or in this case you might be caching just one object just this ball so this is where you can set up what objects you're caching to this chaos cach collection so I'm adding one entry and on that entry I can give it a cash name I'm going to call it ball and then I select the component so I'll click on this drop down and select this ball which is sphere geometry collection one so I'll go down here and select where is it sphere geometry collection one and underneath that we see geometry collection component so that's what I'll select and now it's going to store in this cache here this cache called ball that is whatever is happening to this sphere geometry collection object so that's setting up our cache to record and do all that so now if we click simulate it's recording I'll give it some time and maybe I don't like that cash so I'll just rerun it and get a good break out of it maybe I adjust this a bit more bit more to the edge play it back okay that's maybe a bit better great I'm happy with that so I'll click stop and now it's cached so if I want to play it back I can just go to my cache manager and instead of record I set play and now if we were to play it just plays back that exact same cache every time so if we play it again how does it fall the exact same way now one thing that you can also do is go here to start time and scrub it back and forth to kind of preview uh your cach and I'll leave it at zero but one thing to also keep in mind is that you have this start mode set to timed right now if I were to set it to triggered then it will wait on something to trigger the action of the destruction so it's not actually breaking now because nothing has triggered that event and if you need to set up a trigger to start that event which might be useful in cases where you have your character enter a certain area and then the destruction plays if you're needing to do something like that you can create a bit of a blueprint to do that and as an example I'm just going to open up the level blueprint here just to show very quickly how that can be done and maybe under event begin play I'll trigger that cache so I'll go here and I'll drag out a search here I'll turn off context sensitive and do uh trigger cache and it can trigger component by cache the cach I want to trigger is my chaos cach manager and the individual component inside that cache here that I want to trigger is called ball that's a cach name if you have multiple things you could trigger only specific ones so cach name I'll set to ball all compile save and if I were just to play this now it triggers that cache now just looking at that a little bit closer I'm going to go back up here and open up the level blueprint and add a bit of a delay uh just so we can see how that works so I could set a delay before it triggers so I'll maybe add a delay of two seconds then it will trigger that cache so if I compile and save that and play now the ball will hit and then one two then it starts playing the cache so you can have a little bit more control to slip things forward and back now what if you want control to play back your caches in the sequencer we can do that as well but first I'm going to go up here to the level blueprint delete all these so we're no longer triggering it from that delay and what I'm going to do is create a brand new level sequence I'm just going to call it test and what we'll do now is add a camera cut track in that camera cut track I'll just drag and drop my cash manager then click on the plus and add a cash collection now we're playing back our cash collection ball breaking and we have a little timeline here that we can start keying things for now the problem is our chaos cach manager is still set to triggered so I'm going to change that to timed or actually change the cache mode to static pose instead of play like if I have it set to play and we click simulate okay it does what we expect but if I set it to static pose I can control that pose or what it's doing by sliding the start time so I can use that start time and key it to play it back a different way so I'll set the cache mode to static pose set the start mode to timed and now in here maybe frame 15 start time is zero and maybe at frame 60 it plays let's see five five into it five seconds into it so now if I scrub this you can see how I've keyed it to play back with within that range or I could stretch out that key and it will play back that same range way slower so if I rewind and play in my sequencer we'll see how that falls or if I make this only happen over a couple frames well then when I play it back it's going to be really fast so it gives you individual control to kind of be able to play P back your cash within a certain way now one thing you can also try is go to the curve editor and we can set this start time so I'm going to go here to uh start time we can see we start at frame 15 it starts here and then ends kind of up here we can even adjust the tangents to have a bit of a a ramp where it play kind of faster and then tapers off slower so you can do a lot of things in here and kind of adjust it in certain ways and have a lot of different kind of control on how that will play back so we can preview this now it falls and then slows down so we can kind of adjust that tangent to speed things up and make things play back quite differently so you have a lot of flexibility and control and now it rewinds so you can see how that curve is going up and then down so then the time rewinds and goes back so all that is adjustable through the sequencer as well by just keying the time that you're on for the static pose if you enjoyed this video If you learned something new don't forget to like And subscribe and press the Bell button to be notified at future videos and if you are part of the patreon which you can find a link to in the description below you'll also get access to the PDF going over all the steps in this video and a little bit more information as well
Info
Channel: renderBucket
Views: 15,287
Rating: undefined out of 5
Keywords: unreal engine 5 beginner tutorial, unreal engine 5 demo, unreal engine 5.2, unreal engine tutorial, unreal engine 5.3, unreal engine 5 tutorial, unreal engine, unreal engine 5, chaos destruction unreal engine 5, unreal engine 5 destruction, unreal engine destruction, unreal engine 5 chaos destruction, destruction unreal engine 5, film making in unreal, destruction sequencer, unreal engine caching, unreal engine sequencer, best unreal engine tutorials, Chaos Destruction FX
Id: g7OCjqa9-vc
Channel Id: undefined
Length: 26min 15sec (1575 seconds)
Published: Mon Oct 23 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.