SLICE objects, CUT doors or BREAK them inside Unity!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome i'm your code monkey and in this video let's learn how to do something very useful we're going to do some boolean logic using meshes with pro builder this is super useful for when you want to cut an object to make something like a door or a window or when you want to merge two objects together or just get the intersection mesh it's very easy to do but it's surprisingly hidden so let's learn how to use it if you prefer a more guided path with step-by-step lectures then check out my complete courses learn how to make a builder defender game using c-sharp just like i make my own steam games or learn how to make games internally using visual scripting or learn all about unity with the ultimate overview course which contains over 13 lectures each covering a different tool or feature of the engine to help you make better games faster i'm always available in the courses q a section answering your questions every single day so check out all the courses with the link in the description okay so let's learn how to do some interesting things using pro bimmer i had to learn how to do this for an upcoming video and it actually took quite a while to find out how to do it since the option is hidden deep so i'm guessing most of you don't know about this super useful feature hopefully this video will show up when people search for this so the feature in question is doing some boolean logic with two meshes so it's great for cutting holes merging meshes or getting the intersection over here in this project i have this simple wall object and now the thing that i need to do for an upcoming video was figure out how to cut this object into various pieces so first you go into the package manager and you'll look for the programmer package here i've got version 4.5.2 although i believe this feature exists in pretty much every version so when it's installed you can go over here into tools pro builder and open up the pro bundler window now with that the first thing that you need to do is take this mesh which as you can see this is a perfectly normal mesh and the first thing that we need is just to convert into a programmer mesh so just select the object make sure you're on object selection and then up here there's the really nice pro builderize menu so just click on it and it automatically convert this into a pro bundler mesh okay now i need something to make the cut so let me just go up here make a new 3d cube and now let's say i want to cut a little corner of this okay i want to cut that part on the mesh so now let's see that feature now the reason why it doesn't show by default is because it's tagged as experimental i'm not sure why it's marked as experimental since it's been out for a long time and from what i've used it it always worked exactly as intended but in order to enable it you go up here into edit and go down into preferences then you scroll down and find the pro bundle tab and then over here you see a toggle for experimental features so you just go ahead and click on it and when you do then don't touch anything else it seems like it didn't do anything but it's actually recompiling the programmer scripts so after a bit you should see the box ticked yep there it is so experimental features are now enabled so with that you can now go into tools pro bundler go into experimental and open up the boolean tool all right so this one takes two pro bundler meshes so let's select ours so first of all on the wall so just click and drag the wall and now for the cube i didn't actually probiotize it yet so i can't really drag it so just select the cube and up here and just program the rise it and then now i can drag the reference okay so i've got the wall in the cube and now with both meshes selected then over here we can select the operation so the first one is intersection so let's begin with this one so just hit on apply and now this one creates an actual brand new object so it doesn't modify it doesn't touch the original object so just move it on to the side to see it and as you can see this one is the interaction the intersection between that one and down so just get that nice little corn there so for example in my case for that video that i'm working on where i wanted to create parts of this wall this was the most useful one i just make the cube with the shape that i want rotation that i want then i cut it and cut the wall into various parts okay so here we've got our cut now let's look at the other operations by the way if you find the video helpful please hit the like button it's a tiny thing but it really does help thanks so the next one is union so this one merges both objects so again if i hit on apply creates a new one and there you go so now the wall has this cube attached to it all of it in just one object so perhaps this one could be useful for simplifying your scene in order to have fewer game objects and then the last one which is possibly the most useful the subtraction operation so this one cuts a mesh so for example let's put the cube a bit more down there so something like this okay and now hit on apply and here's my new object and yep look like that it looks almost perfectly like a wall with a hole for a door so you can definitely see how this is very useful or perhaps shifted a bit upwards and there you go now instead of a door now we've got a nice hole for a window so those are all the various modes also over here i'm demonstrating on this nice simple wall but this works on really anything so for example over here is a simple target object looks really nice so it's a target on the stand but now let's say you want just the target without the stand so again just probably rise to target then just grab the cube put it in there and make an intersection make an intersection and hit on apply and yep over here i've got my target mesh so it's just the top part without the bottom also just one quick note here there is a slightly weird issue which is sometimes you can see that the mesh simply disappears that is the only issue that i found out to this and that one has to do with the simple origin of the pivot so when it cuts apparently the pivot for the whole mesh goes all the way far away so you can easily solve that by going just over here into the vertex selection mode and just select the simple vertex set as pivot and there you go now that one is working perfectly so just one quick note and everything else works perfectly okay so as you can see this feature is super useful and super easy to use although it's hidden by default but now you know how it's done stay tuned for the upcoming video which has to do with blowing up some nice walls again if you're looking for a more guided path with step-by-step lectures then check out my complete courses alright hope that's useful check out these videos to learn some more thanks to these awesome patreon supporters for making these videos possible thank you for watching and i'll see you next time [Music] you
Info
Channel: Code Monkey
Views: 49,116
Rating: undefined out of 5
Keywords: unity mesh deformation, unity destruction physics, probuilder experimental, unity mesh destruction, unity slice mesh, unity destruction, probuilder boolean intersection, unity slice, code monkey, unity tutorial, unity game tutorial, unity tutorial for beginners, unity 3d, unity, game development, game dev, game development unity, unity 3d tutorial, unity tutorials, how to make a game, unity probuilder, unity mesh
Id: InpKZloVk0w
Channel Id: undefined
Length: 6min 10sec (370 seconds)
Published: Mon Aug 23 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.