Obby Ideas In Roblox Studio #11: Let You Players Glide

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] if you'd like to learn how to make your player Glide from high places in your Obby keep watching and I'll show you exactly how to do it welcome to Roblox Snippets all right I'll show you how to make a local script that will let your players Glide so we need something to Glide off and I thought we might just use the spawn point in the workspace so if you click on that and then come down to its height let's change its height to be 20 and then come up to home and we'll move it up off the ground so it's level with the ground and we can jump off our spawn point right to make our uh Glide script come down to our stter player and start a character scripts and we're going to add a local script and we'll change the name of this to be Glide local script and come over into our script all right let's create a function so local function and we'll simply call this Glide now we want to run this function uh continuously to check whether the player is falling in our game so we'll use the Run Service uh to do that so up the top create a variable called local RS short for run service and game get service and we want the Run service now down below your function type rs. stepped and this will run every frame so 60 times a second very quickly connect a function uh not the function the Glide function that we just created up here so Glide and that will take care of it running over and over for us so the part that we want to check and remember that we are in our character is the humanoid root part so we create variable for the humanoid root part and that will be equal to script. parent which is the character all right so that's where this ends up and then we're looking for the humanoid root part now the humanoid root part the bit that we're actually concerned with it's called the assembly linear velocity which is a very long property and it makes your code stretch right off the side of the screen so we're going to get that property in a special way we'll create a variable here so local and call it alv whoops moved up a line alv short for assembly linear velocity and over here we're going to put a string there now assembly linear velocity so it's very long and make sure you get the spelling right but once you've typed it once here that's the only time you'll need to type it okay and right below this the only other variable we're going to make use of we're going to create one called speed and set it to -3 and you can put a comment here how fast uh the player Falls right now if you increase this to uh say -10 they'll fall faster and if you go into positives the player will actually go up instead of down which is sort of not what we want so now that we have this uh these variables we can come inside of our function here and write a very simple piece of code so we're going to say if the humanoid root part and then add a set of square brackets after this and add in our a all right so this is the same as typing human root part. assembly linear velocity all right but it's a much shorter way to do it and then outside of the square brackets add a doy and then less than zero and then then now what this means is the Y which is moving up in the air okay if this is less than zero which it's negative that'll mean that the player is falling and that's where we want to make them Glide all right so to do that know we type hrp and then a set of square brackets and alv and then move over and type equals and we're going to create a vector 3. new and you'll see X Y and Z so we actually want to make use of um this only X so if you take a copy of our first one up here with the Y and simply change this to an X and then add a comma the Y number is going to be our speed up here so we're type in speed and then if you copy again and change the last value to zed then we have our x y and Zed all right so this is the humanoid root part assembly linear velocity dox and the same over here for Z and that is all there is to the code all right so come up and click on file and save and let's give it a play right I've spawned in on the top of my giant spawn point and if I run and jump off you'll see that I can control my character left right and they Glide to the ground for my main game Obby if you've been following along uh I'm not going to cover that here however you can um copy the script and put it straight into your sted character and everything should work just fine so I look forward to seeing you in future videos if you found this video useful subscribe now for more information about my online courses go to Mr Brandon ross.com
Info
Channel: Roblox Coding Snippets
Views: 49
Rating: undefined out of 5
Keywords: roblox how to script, roblox how to script for beginners, how to script on roblox, how to script on roblox 2024, how to script on roblox for beginners, how to script on roblox studio 2024, roblox beginners guide to scripting, roblox coding tutorial, roblox coding tutorial 2024, roblox scripting basics, roblox scripting for beginners, roblox scripting tutorial, roblox scripting tutorial 2024, how to code on roblox, Obby Ideas In Roblox Studio #11: Let You Players Glide
Id: tYA1Rmnvt2w
Channel Id: undefined
Length: 5min 54sec (354 seconds)
Published: Fri May 31 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.