How to Make a Physics Door in Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys welcome to newre Engine 5 tutorial today I am going to show you on how to make a physics door so with our player collction we can push the door with physics and it will open and then close with time it's going to be a very easy to follow so let's get started but first check out my new on real Engine 5 course with game Def TV on how to make a full stealth Assassin game with blueprints you will learn how to make a whole bunch of different mechanics that will turn you into a pro on real game developer this course will supply you with all the resources and assets that you need so you can check it out right now through the link in the description all right so the first thing you have to do is go ahead and create a new blueprint in this case let's go into cont browser right click new blueprint class and it will be an actor because we are going to place it in a weld let's call this something it's say bpor physics um door and let's go ahead and open this blueprint up okay so now what we need to do is add the door models itself so in this case let's go in to add a new component static mesh and let's begin by adding the door itself now in my case I am going to be using the um uh this door models okay which comes in the starter content okay so if you created the the project I don't have this um door models that is because you didn't import the started content so what you can do is go into the add button here in the content browser go into to add feature or content pack content and import the S content okay and of course if not you can use use your own uh door models but in my case for this example I'm going to be using this so let's select the door model which will be SM door okay we have it here great and then let's go ahead and add another static mesh uh which will be the frame and of course make sure that they're not child of each other whatever they're separate just under uh the scene route and for this model is going to be the door frame and now we're going to select the door and just move it a bit to the left okay and in this case I think that if we put here 45 it there we go align perfectly as you can see so now we have those models in place so the first thing that we have to do is enable uh the simulation physics for our door because of course it's going to be moving and for you know an object that real to have physics we have to enable this checkbox to simulate the phic but as you can see it is disabled and that's because this door model doesn't have a collision so let's double click on the SN door to open the model up go up into collision and we can you simply generate a box simplified Collision this will just make a little box around the model save and close and now it has a simple Collision now we can go ahead and um go ahead and turn the simulate physics on and now of course we can go ahead and have physics on that great so now with our frame we have to do selected go down and make sure that the Collision presets are to no Collision because we don't want our door with physics to be interfering with the Collision of our you know frame and door itself so that's very important and with now that said we have our door with physics but of course we need to be able to um adjust the angular limits that this door can turn on someone right now if I were just to you know drag this in it would just fall so what we need to do is add a special component which is the physics constraint now I have already done a tutorial in the past about this um component and it's very useful so what I need to do is basically as you can see change a bit of the axis um angular limits that this door can go right now as you can see it is pretty much like a 360 sphere so it can kind of Go in all directions and we don't want our door to be flying away so I need to do is go down until we see the angular limits okay not the the linear it will be the angular limit and first of all for the first swing we want to leave this on free but for the swing two motion we want to put this unlocked as you can see that got rid of the vertical sphere and that's because well uh we don't want our um door to go into that direction then the same with that twist motion locked because we don't want our door to move and we're going to only leave this swing one motion because we want our door to rotate like that in the horizontal axis okay like a door would open that's why great now the thing is that if we leave this on free door would just kind of fly away so let's check this out but first let's go into the constraint open up the component and it's plug in here door now this will be the attached component so you can see where saying that this door will be attached to this physics constraint now very important the name has to be exactly name of the component which is door so it has to be exactly the same uh Reas okay now if we compile I drag this this in now very important we need to add a bit of separation between our floor because they may Collide so let's go ahead and just put like one on here like even a bit less5 right and it will be a bit elevated so that would not interfere and now if I go you can see door will rotate pretty much like those Hotel entrances right and that's because the pivot of this physics constraint is at the middle so first of all let's go ahead and change the uh limit as you can see was like turning in 360 so we can just put it in limited and I specify the angle in this case normally doors we going to open up uh like 90° now as you can see this is in the wrong direction we can open our door like this but that's not we want so let's go ahead and go into the rotation tool and literally rotate this around - 90° and now yes put it to the left of the uh door frame because of course we don't want that hotel entrance right we want a normal door so now yes with that said as you can see when I press play it can go into my door and it will open up with my Collision it looks super cool but of course it doesn't really go back to place you can see kind of go back to place but that's because of the physics it goes and opens again so let's make it that we return with a bit of force back to his original point so for that let's select the physics and strength and we can go down into this angular mod and we can change the mode to be twist and swing just enable swing and then we can leave the strength as default will work and now you will see that indeed okay the door will return back to place but it does make a whole little Loop and then we just very slowly go back so we're going to actually change this and let's select the door and what we can do is just change the angular damping okay we're going to increase this to around 15 and now because we changed the mass and angular damping and as you can see we'll go back to place with better motion and there we go now it looks perfect and very important okay guys make sure that your door is a bit elevated from the ground because if it collides it will kind of you know because it's physical it will uh do friction with the ground and it will not close or open properly so that's very important all right guys that's it for this throw if you found it helpful I would really appreciate you can like the video and subscribe to my channel remember that the pr F available in my patre you members so check them out I check out my course of game that TV Link in the description join my server follow me on my socials and now yes I said [Music] bye-bye
Info
Channel: Gorka Games
Views: 11,318
Rating: undefined out of 5
Keywords: games, videojuegos, unreal engine, unreal engine 5, ue5 physics door, tutorial, quixel, megascans, unreal engine physics door, physical door unreal engine 5, ue5 door physics constraints, physics door tutorial, realistic door, unreal engine 5 how to make a door with physics, unreal engine 5 physics on doors, unreal engine 5 physics door system
Id: 30G-WJ5aMpA
Channel Id: undefined
Length: 7min 42sec (462 seconds)
Published: Tue Nov 14 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.