🔴Physics [Game Maker Studio 2 | Basics]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
although there this is one of any I just wanted to give you a neat little project to mess around with physics because you can actually do some really fun stuff never I have this one leg round here and you have three kind of objects one is very heavy so this is a stone this one is a rubber and this one is wood they kind of bounce and fall differently and I will just explain in a few seconds what how you can actually set that up quite easy because I saw some tutorials and they were like going through some really theoretical stuff without real application like now let's do some fun thing so here it is this is one up indeed I am the develop of the indie game clunky sauce and a programmer slash fix lawyers know if you are new here and you want more consider subscribing to my channel because I try to upload every day and video and share my stuff because I think this is definitely a cool thing to mess around so what are we having in our room it's not food but complicated first of all we have these objects so basically all your physics things again objects but and here comes the big part you need to enable physics and here you just set up what some parameters if you like you don't have to but of course this is a nice start yeah you just say hey we're your gravity's gone so for example if your gravity Y means downwards but if you want to have gravity in other directions well paint the values here and here you see a strange pixel to meters ratio it just means how many pixels are kind of translated to meter because the physics system is a separate piece it is running kind of side by side with the game maker studio but it has its own rules and therefore well it updates differently but I'm not gonna go into disease of details because let's do the fun stuff so here just play around if you like this and therefore you have been let's say gravity of 50 though that doesn't mean it's 50 pixels downwards no no no no no it's moving the ratio of 0.5 so how can we actually use this physics fist first of all we need to enable it in the room this is the first thing then for example we create our first thing which is wall then what basically just took a sprite say he uses physics mark this guy here then this is basically just already our boundaries and then we have let's say for example a stone wall and this stone ball is having a collision with another stone ball a rubber and the wood ball and of course the war so if you start and flagging as physics and you put in an empty collision because they are empty there's nothing in there it that just as game makers till you hate those two things have some interaction and what kind of interaction well you just go under physics then you find those values which you just set up and therefore you can actually design how they interact and how they will pan out and I will just go quickly into the details because what what those values mean there may be overwhelming and stop at some point you just will just mess around with them then they will feel natural so the first thing is density so if you put it in to zero it means it has the highest density this thing cannot be moved therefore it's perfect to be thing which is unmovable walls which are restricting you then the the higher the number goes for example our rubber has a value of 1 and therefore it does react differently and it has a different property concerning collisions so let's go to the ball here again then the next thing is the restitution but I would call it the bounce factor because here you just basically decide how much offer bounce you have so for example um the stone which is kind of heavy doesn't have too much bounce so we do subtract this BAM falling down no problem but let's say for example we do with the rubber it is bouncing like crazy from but all the things because it has a different restitution value so this is the the one thing then the next is collision group yet no need for that today and then those three ones are friction friction is just basically reducing your velocity so the first one is basically if you are having two instances which are colliding then well you reduce their velocities focus on one and setting the other one and then they both have lesser speed as a end result angular damping is for example if two instances are hitting as well but here how good you can rotate so for example my good thing as a higher angular dampening then the stone thing cause here as you can see it can turn around but the wood thing and turn around faster so here this is the angular and here of course you can play around with the values because of that well it doesn't lose its velocity it can rotate faster and then the last one which is friction this is again a loose of velocity for example once something is hitting and going down here then how fast can it actually go round yeah and this is the basics and the the thing is for example you're thinking okay so the collision is based on the collision mass of the sprite and to that I say yeah that's completely wrong because it's not that they are separate shapes and you find them and a modified collision shape because you have just three kinds of shapes so one is box but you can define here and circle which just makes sense because they are balls and then convex shape because maybe you want to have a different shape and here you can actually make your own but here for example once we started you will see something very curious that we Lily we just put that in and you're thinking what the hell is actually happening here why is there so much space well because this is your actual shape this sprite you have an S and overlay it's just basically because Maddox which you just put on top of it so how can you actually check that out well there is a neat thing and here you can just show it with physics world and this is a world property so here if you didn't want to change your gravity or your pixel to meter ratio you could say it with pixel world create and you but set it up here so maybe you want to change your gravity during runtime because why not or if you want to say is get some debug information and then for example here you have different kinds of ones you can put in which is go for the shape which we are using here some physics debug render shape start it again now you see something curious because this is the shape this is my rough diamond which I'm letting forward and down this is actually the other thing and the other ones have regular round shapes that was pretty much it mess around with those things this was just a basic introduction so you can actually play around and use them so what is this basically useful but if you are having let's say a pinball or if you are doing let's say Angry Birds kind of clone thingy where you need to destroy things this is then for you that was for today have a good one one of Indy [Music] you [Music]
Info
Channel: 1up Indie
Views: 5,436
Rating: undefined out of 5
Keywords: how to use physics gamemaker, gamemaker physics, gamemaker physics tutorial, gamemaker studio 2 physics, game maker studio 2 physics tutorial, gamemaker studio 2 ball physics, game maker tutorial, game maker studio tutorial, gamemaker studio 2 tutorial
Id: 7myvDShiHEo
Channel Id: undefined
Length: 8min 49sec (529 seconds)
Published: Mon Jan 27 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.