Unreal Engine 5 - Physics Control (Brief Breakdown)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys I'm back with another video so I want to do a real quick uh overview uh that's a little bit more in depth on the uh physics controls so this is going to be a really quick video uh don't expect it to be super in-depth uh there is no other videos on this out there uh that explain this in any detail at all so let me just go ahead and explain to you so if we right click and we edit this you'll see they have this physics control right here how did they get that because a lot of you are probably not going to be able to know uh how to enable that you can go up here to plugins type in physics physics control and it's experimental and so you can enable that restart your project and once you get back here you'll see that you can add a physics control by a physics control component right here this is these are the settings they're using so the first thing that they do right here is on event tick they seem to be firing this why are they firing this on ventec well it's just because they wanted to share this functionality between all of their uh Blueprints and it made it easier for my unassuming so you'll see right here this is on by default but in the parent this is on the parent this make controls function we can come over here and you'll see that automatically turns it off so I'm assuming that it's only firing once uh and that's it so right here uh they're setting a constraint profile for all on the skeletal mesh this is a physics uh a physic physic asset profile so under profiles constraint profiles current profile you'll see they have hinges only I made the new one by accident um if you watch my other video on setting up constraints you'll physics assets then you'll have a better understanding of how how they did that so back over here you'll see that they have a limb set set up data this is just a variable type it's not an asset that exists on the project it suggested that they came over here and they typed in physics control and they selected one of these in this case it's a limb setup data type right here so it's an array and it holds the limb name this is just a name that you're going to use to access it and the start bone and that's the Neko one so if you on theirs they actually didn't include the parent bone uh I was just playing around with it so if you include the parent bone of Necco one that would be spinal five for spino2 you would think it would be spinal one but for some reason there is his return on pelvis uh it's skipping spinal one I don't know why uh so if I go ahead and play it here you'll see that because they are including the uh the parent on theirs but their parent is returning as uh pelvis not spino one so spinal one actually isn't on that list anyway so make controls for limb bones it's making all the controls for all the separate bones that are attached to that Target uh that start bone so you're saving that into a map uh that stores a name and a physics control name array and then on this one uh they're setting all control uh storing all controls to a physics control name array type they're calling it SK all controls for this one it's World space they are disabling these controls when they create them they're creating them with without them being enabled so they enable them when they need them which is on the child blueprint I'll show you here in a minute the SK linear strength so linear strength is it seems to be the speed at which the uh control will move the bone to its Target location and angular strength is the speed at which it'll turn towards its Target rotation so on the AAA controls they're doing that in parent space I'm not going to pretend that I know exactly the reason why they're doing this in a world end parent uh but it is needed I've tested it out and removing them does break it so after that they need you need body modifiers for the limbs they're restoring those as well because they're going to use them later they're using the skeletal animation and they're setting the gravity multiplier to zero now the reason why they did that is so that the limbs would not be stiff the reason why the lens would be stiff is because if gravity multiplier is set to one then these strength values have to be dramatically higher which makes it which makes the the movement of the joints stiffer so whenever they impact something they'll look stiffer and less realistic it'll look less natural so they decided to set gravity multiplier to zero so that they could use lower values that would result in more natural less stiff movements on impact so that's the reason why they did that and there's a note in here that explains that so if we come back over here we've made our controls uh now they have to set all the controls to be simulated they should set their feet to be kinematic I'm not going to go into too much depth on that uh over here now they are enabling all of these controls so remember they only enable them when they need them so right here they are they are enabling them for each that's what the set all controls enabled it does and it takes the array of the bone names and over here they're setting the control linear data for the pelvis they're just setting the strength enabling the control setting the control multiplier for the pelvis enabling that control um this is supposed to allow head bouncing again they're enabling the controls I'll do another video later on but right here they're doing a set control Target orientation and that's apparently to orient it because they needed to tweak it since the animation looks down now I actually haven't looked into these right here but they're using those somewhere right here this is where they're making uh they make named control and this is actually what controls uh making the hands follow uh the steering wheel so you say they have the will as the parent mesh and they have the static the skeletal mesh is the child and they're using the child build name hand L on this one it's and or they're amazing they're they make a physics control Target uh that's the will that's a scene component so this scene component is actually on oh you can't see it in here it won't let me show you let me just uh there we go so this is the scene component and it's just moving that hand to there so if I disconnect this and I play it you'll see now the hand is not attached to the steering wheel so we will hook that back up now they're rotating the root of this will here and the steering wheel and the axis and all of this is underneath it so when you rotate that everything else rotates with it and that's how they're doing that and obviously they have their hands attached to these or following these scene components and since we're using physics controls the hands don't go through the object uh the object's Collision so that's why this is uh so useful so yeah so they're they're using that disabled Collision for between the parent and the child bodies on this one and this is the control that moves the hand uh well that will move the hand to this so if you if you mess with this grab strength you'll see that if I turn it down too far um his hands go through it because one they have this disabled I guess that doesn't control that all right well I'm still learning um so if you turn it down too low it won't look very good but if you turn it up too high you'll see uh it moves really fast and that's because like I was saying in this grab strength here it controls the linear strength in the angular strength and that is this that's basically the speed at which it will move towards the target as far as uh the steering wheel and everything goes they're uh calling this function right here or this event at the start of the tick and then they were come they were coming through here and uh they're setting a new time for the stick will timeline I'm not exactly sure the reasoning behind this uh math I haven't looked into that but basically these Alpha values or these values that are coming off of here is what's controlling the strength the multiplier which will move their hand towards the stick and then back to this this steering wheel and then there they're modifying the rotation of the stick root right here using another one of those right here and this is all in the same timeline they're just they just have different tracks for each and this keeps them all in sync and that is pretty much it for this one let's see so it looks like this event might be called by the parent foreign control character uh it's on here somewhere this is the driver I'm assuming that this is getting this is getting called probably from a trigger or something in it turns it on or off I don't know exactly it's being called from somewhere anyway if we come over here to this other one I'll go ahead and do a rundown of this one and now on this one they're doing something uh they're doing something similar so right here on the insure control if we find the reference for this one this one's being called every tick so it's checking these I'm not going to go into those but it's making uh the controls and that's stored on the parent same thing we've already gone over that uh let's see and then they're setting this to simulate the hands they're setting the hands to kinematic and then they're setting the constraint profile for all to No Limits so again on the if you go to the physics asset that's where that those are and here's the No Limits one you can see there doesn't seem to be any limits on these controls on the hinges only you'll see those changed let's see what else changes between these the knees and I think right here too it's hard to tell okay so anyway right here is where they explain the reason why they uh used a gravity of zero and there is some more explanations right here use a set of constraint profile of Branch function if you want to experiment with the native enabling limits on just body parts of the body right and then this is where something new arises and right here they're having to set the limb SK prems for each of these limb names remember over here in the parent we have our limb names right here uh you could have just done it it could have just grabbed this one and did a for each and grabbed the 11 name off of that one and uh plug to that empty here uh but he needed he needed to set the params individually for each one and these are all stored separately right here uh let's see oh yeah no these are these are these they have different parameters for each of the different types here same for the AAA he has a linear strength of zero for that and so he has to do this for the world space and for the parent space bone controls and body modifiers and that's what he's doing here and it's just uh getting the limb name and it's checking this uh to find all to find the one that corresponds to that so again if we come over here and we toggle a break point uh you'll see that it has a name here and under that name it has an array of bone names and it just sets the controls for all those bone names all at once and it enables them and that's what he's doing he's just enabling the controls uh for those use and that he's plugging in this param data so there's nothing special uh about what he's doing here it does seem a little confusing at first he's using a uh he's got a hit reaction event and that's fired from the player to add an impulse that's just for demonstration purposes uh and this one seems to move the character left or right this is on the animation blueprint yeah so if you follow this uh you'll see it's just an animation of him moving to the to the right and then the other one is an animation of him moving to the left and and he's checking if it's left or if this the desired state is right and so if we come back over here you'll see when he when he sets that to left or right it makes the character move in that it makes it play that animation and that's what he's doing here and then it seems to just call itself again so it's a recursive function that just keeps moving them left to right and it flip-flops every time and that's pretty much all that's to that so that's uh that's the rundown guys and I hope that made things a little bit clearer for you I'm still uh learning this and trying to get familiar with it but if you if you apply some of the stuff that you've learned from physics physical animations uh it works off of the the primary uh principles that that one does as well so I'll just keep that in mind when you're working with this uh there are no documents on this yet and there are no other videos yet as far as I can tell unless I overlooked it uh if you have any questions feel free to ask down in the comments and I'll see you in the next video make sure to like if you found this helpful and I'll see in the next video
Info
Channel: Unreal DevOP
Views: 4,274
Rating: undefined out of 5
Keywords:
Id: siVuxATg4sY
Channel Id: undefined
Length: 21min 45sec (1305 seconds)
Published: Fri Nov 18 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.