Blender for UE4 - #13 Custom Collision

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
and I'm welcome back so in this lecture we'll be looking at the collisions and how we can export different collisions from blender into unreal now very quickly I'm going to be using some of the information provided by the Unreal documentation so if we go over and take a quick look at the official web page I'll provide a link to this in the course notes below as well so my about copying down the full extension there but if you want to check this out that will be in the notes below so this is the official documentation provided by epic for collisions and what we'll be doing is we'll be looking at how we can take a slightly more complex model and give it a closer fitting Collider but with less information so making sure the pointy kind everything's still lower on it where possible now if we scroll down this page and have a look for the UCX collision details so this is what we'll be focusing on so we're going to look at convex objects and we can make a mesh specifically for that collision the details I run through in this lecture will also be applicable to the UB X and the USP that's what spheres and boxes but we're not making a sphere or a box so this is going to be more designed and targeted towards the UCX match it's probably the more complex one anyway so if you can get your head around to do this you can work out how to do it for a sphere and a box if you wanted more information on this I'm going to show you how to do it but there's so much information here you can see how long this web pages anything that I miss I or any things I haven't mentioned then do check this this page out and you should be able to get all of your answers from this one site so the documentation is really great on this so back in blender if you still have all of the objects from the standard startup file what we can do is remember we press a to select everything and then X to delete everything so now we have a completely blank slate from here I'm going to use my shortcut which for me was alt & num pad - to import something and I'm going to go to my desktop and imports rock 5 ok and with that imported just to mention really that this is just a model that I've made for different project this fairly simple but also has enough detail for me to get across some of the points I want to make in this course and it's just easier for me to provide you with a model that we can all work with the same thing so if you have any question but I can hopefully answer them a bit easier so with our Rock imported that's what it looks like I serve sort of low poly concept rock and what I'm going to do is imagine you're not going to make any changes I just want to dis and blender to begin with if we actually head back over to the Unreal Engine first of all what I'm going to do is I'm going to import the rock as it is so go to import find the rock bring that in as usual allowed to generate collisions if you want to and with this in the content browser if we actually double-click this we can get a bit more information on the model so this is the rock is untextured it we can add a texture if you wanted and it's just because I didn't bring one in that looks a bit better and what we're interested in finding is the collision so if we look up here we can see the bounds so that's the amount space it takes up and the collision so remove everything else at the moment so the collision at the moment is the set of purple lines so this is because the Unreal Engine has tried creating its own set of collision details now we can delete this if we wanted so we can remove collision you'll see the purple box goes away if we go back up to collision we can add a sphere so this will be represented just my spherical collision controller to get rid of that we can add a very high point simplified collision so that's going to be a little bit that's probably what it provided first of all and we can try some lower versions as well which is a bit more like a rectangle so you can see that it has a pretty good go at this it's not really perfect and with collisions on things like rocks they tend not to need to be unless you're having a lot of interaction with them and the player now another way that we can do collisions is we can do an auto convex collision and then if we look down here we can choose how accurate we want this to be and if we hit apply is going to create a very close-knit Collider so you can see this is a lot closer than we had before but the other problem of this is that it will also have a much higher poly code having a lot these rocks with really high collision high-precision collisions is also going to be very very performance heavy so what we can do is rather than leaving this to chance or control set that again in fact I just remove collision again what we can do is we can take charge of this and we can create our own colliders and the way we do this so we'll go back over to blender we will follow the details of here on the webpage we can go to the section which tells you how to make a ucx Collider so what we want to do is get a Collider which is roughly the same shape as our rock but much lower in the poly code so a really great way to visualize this in blender if we press the said we get a wireframe of the object we have selected so we can see how detailed and how many edges and verts this this object has if we go into the press tab we can actually see the vertices are highlighted as well now back in object mode so tab back to object mode what I want to do is simply control-c and control-v to get another version of this I'm just going to move this to the side so make sure that you selected rock zero 5.00 one which is the new version of it which is copied and this will be our Collider so the cleaner that we're making is another physical object at the moment but when we bring it into the engine and because of the naming convention that we're going to follow this will be completely transparent the user went here the engine knows that this is to be used as a Collider and not as a visible object so what we want to do is go up here and find the modifiers tab so this is the panel I've mentioned before this time I'm going to add a modifier press an add modifier and go over to generate and we want to get a decimate modifier so decimate is going to destroy vertices essentially it will remove extra information so it's not selected we have a ratio of which we're decimating here so one is notal which is the full value we have all of the vertices and we can drag this down and we can see that the object is getting simplified and to the point where it's just a simple three points simple tripe essentially so somewhere not quite that simple but before it starts losing too much shape we press said we can see that looks still a lot like the shape of the rock and as far as watching how this would collide of the world how something would stand on it it's not going to be very obvious that the point of collision is not spot-on there's a bit of an edge here which you might see the player would fall through a bit too soon and you can play a bite of this if you wanted to get a bit more precise it depends on how accurate this needs to be but the point is we've lost a lot of vertices on this and the shape itself is pretty much the same so if we make sure this is put back to zero zero zero on location so it needs to line up with the original model and then hit apply on the modifier so that's now applied that decimation to the second model that we made we've been press said to get that back so we can see them overlapping each other which is exactly what we want now the last stage is we're going to go up here and we will rename this so right click and rename and the easy way to do this is just keep the rock 5 - leave the 0 0 1 so it is case specific so you see X and then underscore and then after that needs to follow the name of the object that the collider is for exactly it is red net which is what we have and you can make different versions as well so if you wanted a few different levels of collision you can have use the X rock 5:01 you can have underscore 0 to underscore there at 3 and so on for as many points collisions you need but because I know that we only need one point of collision I'm just going to leave that as is okay so that is the rock and the collision set so now let's pass this if we press a and press a again to make sure that that has be selected everything and then select everything so we now have both objects selected in the world going to o+ to export we'll export this to the desktop save over the original rock 0 5 if you have that we're going to head on back over to the Unreal Engine I'm not going to close this and I am going to delete that one and completely import it again this time it doesn't always match our just my personal approach when I'm trying to change things with colliders and I just find it to be easier to work this way so very important rate the collision if it wants won't matter though because what we will find is now if we go on to the collision we can see our purple box is in fact the one that we had and that's not that clear I just realize that that could have been the one it provided earlier now I know for a fact that it worked but one way we can test is if we go back to blender I'm going to grab the UCX rock I'm going to get the scale and I'm just going to make it bigger I'm going to select everything again so double tap a going to explore this again overripe rock zero five and then we'll go back over to the Unreal Engine going to be a bit laser this time and just reinforce and now we can see that the custom Collider is the one that we created in blender because it's much bigger than the base rock and you could probably still get away with decimating that some more removing some more verts and edges a completely optional this was more to get a concept across from not trying to make the most optimized object right now but hopefully you can see how that could be a cleaner option than having something which would create as many poles and versus it needs to keep it as accurate to the object point size so that's what we're going for in this you've now seen pretty much all of the different ways we can get different colliders in and as I said you've got the UV x and USP option as well for the boxes and spheres but really it's exactly the same concept just by changing the name is the only difference so in this lecture we've covered the concept behind the default unreal colliders the different options that the Unreal Engine provides as well as creating your own Collider via blender to try and keep things as optional as possible so you leave that there for now and I will see you in the next lecture
Info
Channel: Strigifo
Views: 22,041
Rating: undefined out of 5
Keywords: UE4, Unreal Engine 4, Epic, Udemy, Strigifo, Udemy Course, Discount, Student, Education, Educational, Learn, Blueprint, Game Development, Course, Online, Video, Tutorial, Blender, UE4 Blender, Blender Scale, Blender Export, Blender Udemy, UE4 udemy, StrigifoBlender, UV mapping
Id: tRYEFshWqng
Channel Id: undefined
Length: 10min 41sec (641 seconds)
Published: Sun Jan 29 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.