Fixing and Modifying Collisions for Static Mesh Shapes in Unreal Engine 5 #ue5 #unrealengine

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so I'm working on this little visualization project where it's pretty simple concept it's just so people can get an idea of the space that I'm working with and you'll notice just testing it out I hit the spot where like hmm strange I can't go any farther right so there's something going on here that's not letting me go into this area that seems like it should be fine right also related notice how I can just walk through the door here we'll come back to how that works versus that hitting there uh and how to do that specifically so let me jump out here and take a look what's going on so right about here we were running into something so let's visualize the collisions that are on so you can go up to show and turn on collisions you'll see I have this line here this is representing my invisible barrier so first thing I need to do is figure out what's causing what what piece of geometry similar to see these steps here this shell here represents the barrier of the steps which is something I'm also going to change soon because I need the character to go up the steps and I can't have this barrier here I need it to follow the form a little bit better but let's just take care of this really big one first so what's causing this line which is our Collision I found the quickest way to do it is just select the shape you think it might be coming from and so in this case this wall and hit delete and as I delete that you'll notice that that particular Collision line went away as well so let me undo that and this is telling me that this particular shape is what has that extra large Collision you would hope the character could go all the way to the wall but it has this Collision out here so that just happened during import so this shape was created in blender and just imported let's go take a look at that so I'm going to right click browse to asset so here it is here I'm going to double click to open the asset so it's this big wall and the wall the default notice how the the shape it's kind of at an angle so if we go up here to show simple Collision you'll see that the automatic Collision was set based on the shape being at a straight angle but this is at a non-straight angle so therefore it just made this Collision like this in certain cases this may be totally fine but in this exact case I need a little more access to the wall here so what I'm going to do is go to Collision and remove the current Collision so now the wall has no Collision the character would run right through it I'm going to make my own so I'm going to go to Collision add a simple box collision and it does the same thing you'll notice it made it aligned with the world but you have control over the Collision shape so I'm going to switch over the top view a bit more and selecting the shape and rotate or hit e and I'm going to rotate the Collision line up here for what I'm doing it doesn't need to be perfect but I'm going to try and make it perfect anyway that's fine go back to perspective and make sure that looks fine so you can see the characters all right let's go just a little bit closer and selecting it nudge you back just a little bit it's a little rotated actually I think the shape is not exactly the shape has a little bit of a bow in it as well just a little bit because it's the side of the ship and we'll say for what I need it to be see a little bit of a gap at there but that's okay the character is not going to be running in the corner of this particular wall so then I'm going to hit save and close that and come back here and let's go find that spot again so running through running through all right now when I get over to here I can go all the way to the wall and I don't stop anymore where I hit that invisible barrier before because we've cleaned up that Collision and so similarly you can see remember there was a a spot right here I also need to put a hole up in the roof there if I want my character to go up anyway so notice how I can run through this particular shape here but I have a firm barrier there and a firm barrier there now what I did for that one just to go back in history here so same thing I browse to the asset I'm going to double click to open it and I've already customized the Collision for this so if I show Collision it also came in with a really messy huge Collision but what I did is I have three Collision cubes nice and simple so it doesn't take up a lot of memory you could turn on super complex where it's going to totally form fit well let me show you what that looks like if I turn on complex Collision you can see it created this Collision that was very form-fitting but actually I didn't want it this form fitting because I want my character for what I'm doing I just need people to explore the space so I don't need them to have to jump over this little threshold here I'm fine with them being able to pass right through the floor so I don't want to use this super complex collision and I also want it as light as possible so what I did was I made 3 three boxes so same thing I cleared off all of the collisions let me show you here I went that's a good idea let me just delete the one I don't want to do it all over again so delete selected Collision I got rid of just that one there I have one here I'm going to alt drag to make another one or I could have gone up to Collision add a box simplified and resize that you have these other options too but a box works fine for what I need Moon scale to fit that it's a little eh hard to see I'm looking up across the top here if you need to you can switch over to top view as well if it makes it any easier for you so I can see the there's the Collision sliding it in to fit on top of the wall here's the opening here the density of that so I know I'm right at the edge there right at the end of the wall and let's look one more time for the perspective just to make sure I'm not too high top or bottom and all that looks good and I'll save actually it was fine before I saved and made the mess but I'll save anyway and again back to here that's why I can slip right through that door because the Collision allows me an opening again if I turn off the Collision you don't see that but if I turn on the Collision you can see that line there and that line there represents the opening where my character can just run through so again if you need to modify your collisions for gameplay or you know for physics or whatever you just need to go to the asset double click to open it and mess around with the collisions and make sure you save now there is a case to be made for using the complex Collision as a quick fix so let me show you here where I'm running into something right so I'm sliding along so there's some kind of boundary right here that I can't go through so I'm trying to go through it and I can't so and you see it's kind of going at an angle here whatever that is so let's take a look so here in the room I can see this diagonal line going through my world here and I need to find what piece of geometry that is and it's actually not this wall if I select this wall and delete it it's not that wall but if I select this wall out here and delete that that's the culprit right there so I'm going to undo a couple times to get my walls back and actually real quick and delete that see which one that was okay that's Cube six come back here because I can't select it once I get through there so go to cube6 right click browse to asset and double click to open it so I have this wall here this is the one that when I go and show simple Collision this is again what's happening so it just made this box around here now I showed how you can customize and make your own new box Collision but let's for the moment hide the simple Collision so take a look at how dense that is and let's turn on the complex Collision so the complex Collision doesn't look that much more insane it might even be equal to the complexity or density that the simple collision had so what I actually want to do is just use this as a default for the Collision instead of the simple Collision again so here's simple and complex turned on together and I really like the profile of the complex Collision so what you can do is in your settings over here type complex to find your Collision complexity and I want to switch from the project default to use complex Collision as simple so I'm going to click on that and now what that means is effectively the I'm going to turn off simple so all we have now is the complex kind of hard to see in this mode um can I get it a glancing and go you can kind of see a line over there but I showed you a minute ago what the complex looks like and that's now what's going to be used for the Collision so let's save that go back to our main level go back and start to play it's through this little hallway here I know he didn't fall in the hole there that's on purpose so now right about here is where that was and now you see his Fancy free she is now Fancy free to run in that space because we were able to clean up that Collision so that wall is on the other side of that wall there but now we know it's a quick and easy way to clean the collision and it wasn't that bad using the complex now the reason I didn't again do that for these is I want the character to be able to pass through right there I don't want them to get stuck on not being able to pass through so that's why I cut little holes in the multiple box collisions so that the character can just move freely through the hallway another workflow you can do is again for example say I have the shape here I delete it and that's the Collision that I needed to get rid of I want to get rid of this box here from here you can also just choose edit the shape and that will pop you also directly into the edit mode here and again if I type complex then I can again choose this is a pretty simple shape so I'm just going to switch and use the complex Collision as the simple once again if I look at the simple it's kind of a weird non-fitting shape depending on what you need it might be fine but for me I need a little more Precision there so let's look at the complex and not look at the simple and it actually looks a little more simple and it is form fitting so I'm going to switch to complex Collision as simple and save that then let's take a look at it back here at the main level we cleaned that up nicely so my character can now not hit their head as they're running by this shape if that needs to happen actually they need to sneak down these stairs so I had to clean up this area here as well so they have access to this little stairwell to slip down so about the steps in particular I have these steps over here for what I'm doing for this project I don't really need to go up these but let me just show you as an example so looking up these steps if I wanted if I had a hole up there and I want to go up there right now I'm hitting the up Arrow actually W to try and get up the steps right so the other steps work but these ones don't so how do I allow my character to go up these stairs so let's take a look at that so looking at the stairs here I have Collision enabled so you can see it from this view already so here's my collision and this is why my character can't go up the steps I have the simple collisions being used here so let's go look at that and framing in here if I look at my simple Collision that's what we just saw and if we look at the complex Collision this is actually what's going to be needed for my character to be able to hop up the steps so what we can do is and there's a fine detail here that I want you to notice if I switch to use complex Collision as simple I don't need to remove the simple Collision I can just leave it right there because the simple Collision will not be used we're using the complex instead when it does the query to find out if your character can go up so I'm going to hit save and show you this in action so note I left the simple Collision but I set it to use complex instead now when we start over let's run into the hallway here and sneak in there look up the steps and now I can go up the steps and pop my head through the floor again I don't really need the character to go up here for this project with the ship but just to show what that setting does and that you don't need to delete the simple Collision if you may want in the future you may want to go ahead and keep it there now here's a little bit of a interesting thing to point out as well you may for The Savvy viewer you may have wondered wait a minute how come the head can go through the ceiling but it does stop at the shoulder so the Collision is working but not seemingly properly because the head shouldn't be popping up there if the Collision is working well in this exact scene as a matter of fact I needed to do a little cheat to make the environment match with the mannequin size so the environment was built to scale in blender but if we take a look at the blueprint for the mannequin hop in here I wanted the scale just to look a little bit bigger so I did it quickly by just scaling the character but I didn't scale the Collision capsule to size up with the character as well and yeah it's a little messy in terms of you know if I uncheck this scale I could try and scale the capsule but because it's apparent you'll notice it's you know it's apparent in the hierarchy here it's scaling everything else that's a child as well and you know for what I'm doing in this particular project I don't really care it's fine if the head goes through the roof because there's nowhere else where the head's really going through roof so that's just my lazy uh gets the job done you know sometimes you just got to go for Speed versus accuracy and in my case I don't mind that the head goes through the floor because normally the character shouldn't be over there but if you do need it to be accurate your character probably should fit within the Collision capsule just want to point that out that's why the character's head is popping through the ceiling for additional information there is some pretty good documentation on setting up collisions with static meshes here I'll put a link in the description if you want if you like to read and go a little bit farther on some of the details for example some more complex setups you know these are just the basics of sphere capsule and box which we used but it goes through what some of the more mathy stuff when it comes to all the all these different options here there's a good example here that will walk you through that so again link will be in the description and hopefully that's just enough info to get you going on the basics of setting up your collisions speaking of collision I highly recommend you watch this video on why that banana is colliding with the ground and what relevance it has to this stop motion behind the scenes animation from my son Dexter please check it out like And subscribe
Info
Channel: 3D Education with JC
Views: 3,350
Rating: undefined out of 5
Keywords:
Id: 6vzyQO63RCM
Channel Id: undefined
Length: 16min 41sec (1001 seconds)
Published: Mon Feb 13 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.