 All right, so let's finish up our tool and get the actual placement stuff Figured out so I'm going to go into the editor script here And all we really need to do now is come down here And let's make another note and just say replace objects because we passed all of our error checks over here Okay, and what I want to do first is I want to get all these selected objects So we are keeping track of the count. Okay, but what I want to do is get that array of objects So what I'm going to do is get I'm just going to call this a selected Objects is equal to that selection Dot game objects. All right, and that again returns for us our array of objects So we need to make this an array All right, so with that what we can do now is just do a loop. So I just want to do your every day For loop here, so I'm going to say for into I and then I is less than our selected objects dot length Then we're going to increment it For every single one of those objects. Okay, so in here what I want to do first is I want to get all the transform Information from our selected objects or the current object that we are working on So I'm just going to call this the selected transform like so and that's going to be equal to our selected objects the current one so the We use the index that we're currently on all right to get it out of there and we use the transform like so So now we have access to the position and rotation and the scale So with that all we need to do now is just instantiate our wanted object So we'll call this the new object. Okay, and we'll say instantiate Our wanted object and we want to instantiate it at the position of our selected transform All right, so select transform position and we'll do select transform dot rotation As far as I know, I don't see any way to put in the scale So all we need to do from there is to say new object Dot local dot transform dot local scale is equal to our select Transform dot local scale easy-peasy All right, and then finally once we're done with that we should just get rid of the object So we're going to call the destroy immediate not destroy Destroys for when you're in runtime when you actually play the game destroy immediate is what you use in the editor So when you're working with editor tools and all we really need to do is just destroy that selected object And the current one that we're on And voila Pretty simple stuff there, but that is how we go about replacing objects And now there's a ton of things you could do here, right? We could always go and randomize the scale We could add some more information to the objects like changing the tags or something like that There's a ton of stuff you could do this is just kind of that bare bones tool just to get you started, right? So let's go back in the Unity and test this all out now All right, so let's go in launch the tool here, and let's go and create a Cube so I'm just going to put a cube around here And let's just put it off to the side, okay? And what I want to do is I'm going to drag and drop that into my replace object So I want that to be I want all these fears to be replaced with our cube And then I'm going to go and replace all my spheres All right, so we're going to do that select all the spheres and hit replace Selected and there you go. We now have cubes where we had spheres all right, so let's go and Create a bunch of spheres again All right, so let's go and change their scales this time. So maybe they're all a little different like so Just to prove that this is working want to always test all of your tools All right, and let's maybe change the rotation on these guys a little bit some random All right cool so I'm going to select all the objects again and I already have my Replace object working, but this time around let's actually go and make a prefab out of it So we can get rid of it out of the scene and we'll test it out this way. So now I'm going to drag and drop my Replace object or the cube into the replace object object field select all my spheres and hit replace and there you go We now have all of our objects replaced with cubes Okay, so I'm going to close out this little mini series with that Definitely let me know if you guys have any other suggestions for tools I think the next one I'm going to do is a Renamer tool that allows you to add prefixes and suffixes and rename lots of stuff Something that should actually just be in unity But we're going to do that. Okay. Thanks so much. Bye