 Hello and welcome back to Game Dev Academy. I'm Professor Whittington. Make sure you sign the register for me by leaving a comment down below, just like these excellent people did last time. This video is going to cover the blueprint set up for the block. So what we need to do is make it so that the blocks will be impacted by the ball. When the ball hits them, the blocks will cease to exist and that's what will set up in this one. So let's jump into it. Now it's time to get the block into the level and behaving properly. So we need to create the blueprint for that and set up the behavior to make sure that it disappears when it gets hit by the ball. So step one, as you should be able to work out by now, is to create a blueprint for this. So I'm in my Blueprints folder already. I'll right-click and Blueprint Classes is going to be an actor the same as the ball is. There we go. I'm going to call it BP underscore block and then we'll open that up. Okay, so the first thing we need to get in here is an actual static mesh. So let's do that. Add component static mesh and I'm going to call it block because it's for the block and then for the static mesh, I'm going to choose the block from my list. There we go. So far so good. We'll just compile that so it's in place. Now this next step is incredibly important and it will all break if you don't do this. What I want to do is have this disappear when the ball hits it and unless we do this next step, this just will not work because it will never register a hit event and I've banged my head against walls for far too long by forgetting to do this. So let's just do it now while we're thinking about it. So with the mesh selector, we're just going to scroll down a little bit and it's this collision area here that we're looking for and it's this simulation generates let's just move that generates hit events and by default that's turned off. So we need to tick that box so that when there is a hit event it's registered and we can do stuff with it. Okay, so we've done that. Let's compile it. Beautiful. Next job then is to go into our event graph and we'll delete these. We don't need these right now. We're going to use something that comes off this the event. So we'll right-click on the block and there you can see we get a list of events that are available to us and what I want is add uncomponent hit. So when something hits the component, which is the mesh, then it will do what we want it to do. So there is our event and what I want to do is restrict this. At the moment it could be that if anything hits it it will fire off this hit event and we want it to be only the ball that will do it because later when we start making this look pretty and anything so it there might be debris flying around there might be overlapping measures and we don't want those to sort of automatically delete themselves. So from other actor, we're going to drag out of here and we're going to cast to the ball cast a BP underscore ball. There we go. And so now when it reaches a hit event from something it will ask is it the ball? If it is the ball, it will do the next bit, which will be destroy actor. And that will remove it from the game. If however, it's not the ball, it will do nothing. It will still register the hit event, but it knows not to do anything. That's what we want. So when it hits checked. Is it the ball? So it's casting to the ball. It's having to cast to another blueprint for this. So what it's doing is talking to the ball blueprint. And so it says are you the mesh that's interacting? If the answer is yes, okay, we can destroy the block. And that's how it should work. So we'll compile and save that and Now what we need to do is get all these dummy blocks out of the level, put in the new ones and test. So let's go into top view for that, make it a bit easier. I'm going to hold control and alt to allow them to do a marquee selection. Nope shift and alt. Shift and alt to do a marquee selection. Delete all those and now I can bring in my blueprint block. There it is. So I think x and z should both be zero and Then I can line these up. So I'm going to have a bit of a gap behind. I think I'll put it about Let's put it there in line with that. Always in line with it as I can get it. That's really not in line, is it? Well, so I'll place it there and then let's put a little gap between them and then we'll select those three, move them over to the side, hopefully keep the the gap consistent. It looks like it's consistent and then we'll have a few rows of these like that. Is that gap consistent? I think it looks like it. Let's go for five rows. I don't know how many there is an actual breakout. Something like that. Let's go back to our perspective view and now we need to see whether or not these will disappear when the ball hits them. So let's hit play. What goes the ball? Come on, baby. You can do it. It destroyed it. Boom. And that's it. We've now got a lot closer to this function as a game. So as the ball goes up there now it will remove these blocks until either The blocks are all gone or we lose control of the ball. So that's pretty good, isn't it? Well done, Oz. We are so good at this. Right, so that will do it for this step. I'll see you in the next one. Enjoy destroying your blocks. I believe that quality education should be available to everybody and for that reason all of the classes at Game Dev Academy are completely free and we're supported by our very generous school governors over at Patreon. If you'd like to become a Game Dev Academy governor and support our work as well as helping us to steer the channel in the right direction then use the link in the description to be taken to the Patreon page.