Flying Physics - Roblox Scripting Tutorial

  Рет қаралды 47,380

Suphi Kaner

Suphi Kaner

Күн бұрын

Discord: / discord
Patreon: / suphi
Donate: www.roblox.com...

Пікірлер: 228
@5uphi
@5uphi Жыл бұрын
Sorry I misspoke in the video. The density in the equation is the density of the air not the object when we set the drag variable it contains the density in that variable So what that means is local drag = 1 = (coefficient * density * referanceArea * 0.5) then we simply multiple the drag by the velocity squared local force = drag * velocity ^ 2 the reason we use AssemblyMass is to normalize the drag so that all players heavy or light get effected by the drag the same but in real life you would not multiply by the AssemblyMass but as I wanted all players to fly at the same speed that's why I added AssemblyMass
@supervermillion6729
@supervermillion6729 Жыл бұрын
How can we adjust for different animations when moving up and down?
@Revoltition
@Revoltition 7 ай бұрын
do not worry i only read the code not focus on the speaking
@root6132
@root6132 2 жыл бұрын
Videos like these are so underrated
@5uphi
@5uphi 2 жыл бұрын
thank you, your comment motivates me to continue making videos
@JustSimplified
@JustSimplified 11 ай бұрын
I have been coding for almost 2 years now and I have never seen this level of detail in a single video. This is definitely the type of tutorial that people needed
@speedyg2295
@speedyg2295 Жыл бұрын
That was amazing. I just went through your video and you blow my mind by just knowing how to do all that. And the great thing is you describe what your lines of code are doing and how you reference develop site and show us how to use it effectively. Thanks again.
@droid7448
@droid7448 2 жыл бұрын
Lovely video 👏 I recently found your channel through the scripts organization tutorial video, and it's full of really useful tutorials. Great job, will look forward for new videos. 👍
@5uphi
@5uphi 2 жыл бұрын
I hope you enjoy my future videos
@polarcat0156
@polarcat0156 2 жыл бұрын
yea, super underrated. so hard finding anyone covering more advanced scripting and other essential stuff
@KebeMaro
@KebeMaro 2 жыл бұрын
You are amazing , you literally make videos on things that rarely anyone makes videos on and your videos are very good, you're so good at explaining things and doing things in a good way/better way than what most people would do
@5uphi
@5uphi 2 жыл бұрын
Thank you 😌
@Animiribi
@Animiribi Жыл бұрын
This is a great video! You went through everything in detail and took your time to explain the things you use and why you use them. Following this tutorial teached me more than a playlist full of "Lua programming for beginners". Keep up the excellent content :D
@KeyboardistMonster
@KeyboardistMonster Жыл бұрын
He's great, I just started learning and it's the first time I've seen a tutorial this detailed
@oo4278
@oo4278 Жыл бұрын
Script: local Players = game:GetService("Players") local RunService = game:GetService("RunService") local ContextActionService = game:GetService("ContextActionService") -- Get player character local player = Players.LocalPlayer local character = player.Character local humanoid = character.Humanoid local primaryPart = character.PrimaryPart -- Set up variables for flight controls local gravityVector = Vector3.new(0, game.Workspace.Gravity, 0) local yAxis = Vector3.new(0, 1, 0) local force = 400 local drag = 1 -- Set up flight attachments and animations local vectorForce = script:WaitForChild("VectorForce") vectorForce.Attachment0 = primaryPart.RootRigAttachment local alignOrientation = script:WaitForChild("AlignOrientation") alignOrientation.Attachment0 = primaryPart.RootRigAttachment local animation = script:WaitForChild("Animation") local animationTrack = humanoid.Animator:LoadAnimation(animation) animationTrack.Priority = Enum.AnimationPriority.Movement -- Set up function for flying local connection = nil local function FlyAction(actionName, inputState, inputObject) -- Check if input is valid if inputState ~= Enum.UserInputState.Begin then return Enum.ContextActionResult.Pass end if connection == true then return Enum.ContextActionResult.Pass end -- Start flying if connection == nil then connection = true -- Change state to jumping if not in air if humanoid.FloorMaterial ~= Enum.Material.Air then humanoid:ChangeState(Enum.HumanoidStateType.Jumping) humanoid.AnimationPlayed:Connect(function(track) if track.Animation.Name == "JumpAnim" and connection == true then track:Stop(0) end end) task.wait(.1) end vectorForce.Enabled = true alignOrientation.CFrame = primaryPart.CFrame alignOrientation.Enabled = true animationTrack:Play() humanoid:ChangeState(Enum.HumanoidStateType.Physics) connection = RunService.Heartbeat:Connect(function(deltaTime) -- Apply gravity vectorForce.Force = gravityVector * primaryPart.AssemblyMass -- Apply movement force local moveVector = Vector3.new(character.Humanoid.MoveDirection.X, yAxis,character.Humanoid.MoveDirection.Z) if moveVector.Magnitude > 0 then moveVector = moveVector.Unit vectorForce.Force += moveVector * force * primaryPart.AssemblyMass if math.abs(moveVector.Y) == 1 then alignOrientation.CFrame = CFrame.lookAt(Vector3.new(0,0,0), moveVector, -primaryPart.CFrame.LookVector) * CFrame.fromOrientation(-math.pi / 2 , 0, 0) else alignOrientation.CFrame = CFrame.lookAt(Vector3.new(0,0,0), moveVector) * CFrame.fromOrientation(-math.pi / 2 , 0, 0) end end -- Apply drag if primaryPart.AssemblyLinearVelocity.Magnitude > 0 then local dragVector =- primaryPart.AssemblyLinearVelocity.Unit * primaryPart.AssemblyLinearVelocity.Magnitude ^ 1.2 vectorForce.Force += dragVector * drag * primaryPart.AssemblyMass end end) -- Stop flying else vectorForce.Enabled = false alignOrientation.Enabled = false animationTrack:Stop() humanoid:ChangeState(Enum.HumanoidStateType.Freefall) connection:Disconnect() connection = nil end return Enum.ContextActionResult.Pass end -- Set up functions for vertical movement local function UpAction(actionName, inputState, inputObject) if inputState == Enum.UserInputState.Begin then yAxis = 1 else yAxis = 0 end; return Enum.ContextActionResult.Pass end function DownAction(actionName,inputState,inputObject) if inputState == Enum.UserInputState.Begin then yAxis = -1 else yAxis = 0 end; return Enum.ContextActionResult.Pass end ContextActionService:BindAction("Fly", FlyAction, true, Enum.KeyCode.F) ContextActionService:SetTitle("Fly", "Fly") ContextActionService:SetPosition("Fly", UDim2.new(1, -150, 1, -80)) ContextActionService:BindAction("Up", UpAction, true, Enum.KeyCode.E) ContextActionService:SetTitle("Up", "↑") ContextActionService:SetPosition("Up", UDim2.new(1, -55, 1, -55)) ContextActionService:BindAction("Down", DownAction, true, Enum.KeyCode.Q) ContextActionService:SetTitle("Down", "↓") ContextActionService:SetPosition("Down", UDim2.new(1, -105, 1, -145))
@stavros222
@stavros222 7 ай бұрын
I think it's better to first understand what this script is doing
@WoahItsJeebus
@WoahItsJeebus 6 ай бұрын
Would love to see an updated version of this utilizing inverse kinematics😄 Amazing video nonetheless!
@skyblox-eo5se
@skyblox-eo5se Жыл бұрын
swim hacks lol
@Dante010176
@Dante010176 Жыл бұрын
First I was annoyed, because you didn't put the script in the Description. But now I'm thankful for that. I learned a lot more, than I would have by just copy 'n paste.
@5uphi
@5uphi Жыл бұрын
You can find the script in the discord server ;)
@Dante010176
@Dante010176 Жыл бұрын
@@5uphi Oh, ok. Don't know anything about discord. Sorry.
@Smurfis
@Smurfis 2 жыл бұрын
This completely went over my head
@notsebe
@notsebe 9 ай бұрын
Informative video, but i have 1 question left, will other players see trail, or its only client side?
@5uphi
@5uphi 9 ай бұрын
Trail is client sided you would need to use the state changed event on the server side to enable and disable the trail if you want it server side
@krystianek9033
@krystianek9033 Жыл бұрын
I wish I was as smart as u
@DragonsTHUNDER3
@DragonsTHUNDER3 9 ай бұрын
i thought he gonna commit 9/ OMG OMG NO phew. NOO STOP STOP phew. NOO phew.... STOP!! oh phew
@DavidWinstead
@DavidWinstead Жыл бұрын
Wow man, that was an awesome tutorial, mainly because I've been trying to create a flying type of Roblox game for a while now!! You good sir, have just gained a new sub from me and I'll be watching all of your past and future videos from this day forth!!!!!!!
@5uphi
@5uphi Жыл бұрын
:)
@GabrielCelorio
@GabrielCelorio 2 жыл бұрын
Absolutely great video Ive looked for a fly tutorial multiple times as im trying to make a fly command in my game, never found one that worked well, Now its time to try and convert this so that I can activate fly from a remote event.
@tristanvincenzo5925
@tristanvincenzo5925 2 жыл бұрын
Is your game almost done and also I'm making a few games also
@z1912.
@z1912. 2 жыл бұрын
Make sure to subscribe to him.
@5uphi
@5uphi 2 жыл бұрын
Thank you :)
@opticpx
@opticpx Жыл бұрын
can you code a sound bairrier break or sum
@andreyromashchenko8967
@andreyromashchenko8967 9 күн бұрын
My character struggles to overcome own speed to turn around :(
@goreacraft
@goreacraft 2 жыл бұрын
Thank you for this amazing tutorial. Even though i do not need the fly option in my games i still learned useful things from this: the return value for contextActions, the trail effect, how to use the AssemblyMass, AlignOrientation, VectorForce ....
@5uphi
@5uphi 2 жыл бұрын
thank you for watching my video i'm happy you found value from it
@TheRealKensterBoosteryt
@TheRealKensterBoosteryt Жыл бұрын
0:09 DUDE STOP!! DUDE!
@stavros222
@stavros222 7 ай бұрын
9 11 reference ig
@supahchunky7465
@supahchunky7465 5 ай бұрын
How would you make the player face the direction the force is facing? like if the player is falling down the player looks down. Wouldnt that be the same effect as the movedirection but then also for the gravity pulling the player down
@5uphi
@5uphi 5 ай бұрын
Use the velocity instead of the move direction to set the align orientation
@d.veloper826
@d.veloper826 Жыл бұрын
This is the best tutorial I have ever seen on anything in my entire life. From this day forward, you are the god of tutorials to me.
@CaptainFilm123
@CaptainFilm123 2 күн бұрын
wonderful
@Wuking_Bang
@Wuking_Bang 3 ай бұрын
How do i make it double space insted of f
@User-hg9re
@User-hg9re Жыл бұрын
You are great dude and you are not inidan. Its obvious you know how to do your job. Good job! and im subbing for you to learn more!
@timothy676
@timothy676 2 ай бұрын
racism 101
@Anastasiatoons
@Anastasiatoons 2 жыл бұрын
This channel is so incredibly, and I really mean it, helpful ,not only for beginners, but most likely for people who already have plenty of experience with scripting! Honestly my question sounds very underwhelming compared to the content you make, but I still will ask since nobody could help me with it... I have a 2d platformer part in my game and I used UnbindAction to make the player move left and right, however I cant achieve this on mobile, so my question is : How to bind the controls on mobile?
@5uphi
@5uphi 2 жыл бұрын
I'm not sure why your bindaction never works for mobile it should call the function when they press the button
@Anastasiatoons
@Anastasiatoons 2 жыл бұрын
@@5uphi Sorry I ment UnbindAction, here is my script, maybe you can work with that, ik its missing something for mobile to work but idk what that is : local cas = game:GetService("ContextActionService") cas:UnbindAction("moveForwardAction") cas:UnbindAction("moveBackwardAction")
@5uphi
@5uphi 2 жыл бұрын
Oh your trying to overwrite Roblox built in movement script to do this inside StarterPlayerScripts create a localscript and call it ControlScript this will prevent Roblox's default script from being created
@Anastasiatoons
@Anastasiatoons 2 жыл бұрын
@@5uphi I got it now
@Koniak3
@Koniak3 23 күн бұрын
Fire
@alvarivoid6063
@alvarivoid6063 Жыл бұрын
Idk why
@FEG_Studio
@FEG_Studio 4 ай бұрын
You are amazing thank you so much !
@Ultraname
@Ultraname Жыл бұрын
Im not here for the tutorial im here for the result
@serkan1804
@serkan1804 Жыл бұрын
Many thanks for the video. There is an error as 'attempt to index nil with 'RootRigAttachment''. I think it is due to primaryPart being nil. How can i solve it?
@5uphi
@5uphi Жыл бұрын
You can use something like character.HumanoidRootPart
@serkan1804
@serkan1804 Жыл бұрын
@@5uphi i wrote the code below instead and worked local primaryPart repeat primaryPart = character:FindFirstChild("HumanoidRootPart") wait() until primaryPart
@williamsartini5470
@williamsartini5470 11 ай бұрын
@@serkan1804 You can also put character.PrimaryPart in the value of vectorForce.Attachment0, like this vectorForce.Attachment0 = character.PrimaryPart.RootRigAttachment
@Arthuurr_
@Arthuurr_ 5 ай бұрын
No work :/
@5uphi
@5uphi 5 ай бұрын
Make sure to follow correctly
@skeedgd
@skeedgd Жыл бұрын
Oh Amazing I like and Subscribe !! ty !!
@KGplayerA
@KGplayerA Жыл бұрын
Can someone please write the script in the reply so i can copy thanks
@王旭霄
@王旭霄 9 ай бұрын
So appreciate for your work,still waiting for your new tutorial.
@mirodearo
@mirodearo Жыл бұрын
This worked really well but I have one problem. Whenever someone dies while flight is still active, they won't be able to jump upon respawning. I know the reason this happens (which is because I have the BindActions put in a function that is triggered after touching a part), but I have no idea how to fix it. How would I go about rebinding the space key to jumping after a player respawns?
@mggarciazy
@mggarciazy 3 ай бұрын
nice keyboard sounds
@5uphi
@5uphi 3 ай бұрын
Thank you
@donottakemycommentsserious6072
@donottakemycommentsserious6072 Жыл бұрын
Very useful, could this same thing be implemented in a custom water part without terrain? I saw many people in forums looking for answers on how to make customized water.
@TheEleventhDoctor
@TheEleventhDoctor 2 жыл бұрын
thank you for this tutorial, this will be useful to make Smallville Project I've always wanted to make
@nest_playzs
@nest_playzs 2 жыл бұрын
In unity we just multiply with time.deltatime to make the frame based on the time taken
@5uphi
@5uphi 2 жыл бұрын
vectorforce and alignorientation multiply by deltatime so you only need to do that in Roblox if your editing the velocity directly
@nest_playzs
@nest_playzs 2 жыл бұрын
@@5uphi Ok
@d.veloper826
@d.veloper826 Жыл бұрын
Please how can I add more animations to the flight. Like, if I wanted a different animation for the character moving left or right?
@giovanacury7466
@giovanacury7466 Жыл бұрын
this not work
@5uphi
@5uphi Жыл бұрын
This do be working
@Mr.ChiranjitPrenty
@Mr.ChiranjitPrenty 2 жыл бұрын
Excuse me sir, are you turkish? I’m turkish bro
@5uphi
@5uphi 2 жыл бұрын
Yes
@Mr.ChiranjitPrenty
@Mr.ChiranjitPrenty 2 жыл бұрын
@@5uphi do you wanna make a game with me i don’t know how to code but I can build very good my username is dk_41 add me
@CorruptedProgram
@CorruptedProgram Жыл бұрын
how to press the arrow up??
@jacko_o
@jacko_o 2 жыл бұрын
is it not working only for me i am 10 minutes in and i am trying to find whats wrong but i cant find anything. the y axis vector force was working perfectly fine but then i added the alignorientation and now it wont fly or alignorientate
@5uphi
@5uphi 2 жыл бұрын
You must have a mistake somewhere If you message me in discord id be happy to help
@tenko923
@tenko923 8 ай бұрын
This is art!
@quicktime_griddle
@quicktime_griddle 2 жыл бұрын
Can you make this open source? I think most people watching this video didn't want to code an entire flight system from a 45 minute video.
@5uphi
@5uphi 2 жыл бұрын
Its already open source
@quicktime_griddle
@quicktime_griddle 2 жыл бұрын
Is there a pastebin or something I missed?
@5uphi
@5uphi 2 жыл бұрын
check out my discord
@andrassbb
@andrassbb 2 жыл бұрын
@@5uphi it says page not found ? did something happen to the discord ?
@5uphi
@5uphi 2 жыл бұрын
Discord link is still working fine for me
@Dante010176
@Dante010176 Жыл бұрын
Awesome!! Thank You. Liked and followed!
@leinner1689
@leinner1689 2 жыл бұрын
Do you know how to group particles to your hands so you can launch them?
@Александр-д1ф4о
@Александр-д1ф4о 2 жыл бұрын
Thanks for such a helpful video. I have a problem, the animation is visible only on the client side, how to make it visible to all players?
@5uphi
@5uphi 2 жыл бұрын
character animations should replicate to all other players the only part that does not replicate is if you set the animation to loop
@andreyromashchenko8967
@andreyromashchenko8967 9 күн бұрын
I GOT A QUESTION Hi, how can I limit the flying speed? Lower force numbers make turns super delayed, and higher force numbers make flight way too fast (and then turns become delayed as well). So i figured there’s gotta be a max speed limit, while having high force number, for an easy handling in the air. P.S. I don’t know how to script.
@5uphi
@5uphi 9 күн бұрын
You can change the drag value to effect the max speed
@andreyromashchenko8967
@andreyromashchenko8967 8 күн бұрын
Tried that, didn’t work. I’ve spent hours trying to figure out where i messed up. I tried to change every single number in the script to see what they do (that’s how i identified every single mistake i’ve made in your script) (I even figured out how to make 2 trails each coming from each foot, very proud of myself) and the drag value isn’t even doing anything. I think I should find and copy your original script, paste it and see if it makes a difference….. P.S. thank you for your reply, I’m a noob but I’m trying very hard. an edit: (Im trying to find the original script…. No luck so far)
@5uphi
@5uphi 8 күн бұрын
patreon members or youtube members can download the project from the discord server links in the description
@andreyromashchenko8967
@andreyromashchenko8967 6 күн бұрын
@@5uphi I was probably wrong about something….. I’m trying to copy and paste parts of the script that someone posted in your comment section AND while his script is broken, a part of the script successfully replaced my broken part (this is very difficult and I had to rename variables in his version of the script) so far it fixed my issue! My apologies for bothering you… I will investigate the issue to the fullest extent. I will probably never understand what went wrong and what went right. edit: I found what was wrong, i missed the latter “t” in AssemblyLinearVelocity. I absolutely love your script! Thank you and God bless!
@channykun1790
@channykun1790 Жыл бұрын
can you do it on a gui?
@mahirahmed4992
@mahirahmed4992 Ай бұрын
Just set the fly script on a local script inside a text button gui and set it on a event when you click the button
@flame12345
@flame12345 6 ай бұрын
Genius. Truly Genius
@Oosh715
@Oosh715 2 жыл бұрын
Nice video, but how can I add an animation while just floating in the air?
@5uphi
@5uphi 2 жыл бұрын
You can change the animation if the movevector.magnitude == 0
@Oosh715
@Oosh715 2 жыл бұрын
how do i add an animation for that?
@5uphi
@5uphi 2 жыл бұрын
@@Oosh715 you load the animations the same way I loaded the swim animation You set the priority to idle and play it when you activate fly so It players all the time and your fly animation will play when move vector magnitude is greater then 0 and stop when it's 0 if you message on discord I can help more
@Oosh715
@Oosh715 2 жыл бұрын
@@5uphi ok ty
@memerified
@memerified 2 жыл бұрын
E
@5uphi
@5uphi 2 жыл бұрын
E
@g4m3z24
@g4m3z24 2 жыл бұрын
@@5uphi E
@regenttooty3927
@regenttooty3927 Жыл бұрын
Can you make a short video one, because its so lomg I didn’t know what to do LMAO
@farahnuraini8582
@farahnuraini8582 Жыл бұрын
Thank you for this amazing tutorial😁
@soda35160
@soda35160 Жыл бұрын
Thank you
@Aritely
@Aritely 2 жыл бұрын
Hello, how do you not make the character animation go down, like if my character was up but went down? I'll do a donation if you resolve my problem
@bradzandmaxplays
@bradzandmaxplays Жыл бұрын
Good vid but need updating i had to debug it and make it work for r15
@5uphi
@5uphi Жыл бұрын
I used a R15 in the video?
@gkawrbool
@gkawrbool Жыл бұрын
FREAKING AWESOME MAN
@fayez.
@fayez. 2 жыл бұрын
I actually love you so much
@kirbmeister_
@kirbmeister_ Жыл бұрын
How did you do the typing effect when writing lines of code? It doesn't seem like you're actually typing it since you are moving your mouse while the text appears and I can't hear your keyboard while it is typing. It's also very uniform in the typing speed. This seems interesting for when I eventually make my own scripting tutorials.
@5uphi
@5uphi Жыл бұрын
AutoHotkey
@AnthonyNFS
@AnthonyNFS Жыл бұрын
This is awesome! Really impressive and I like how you went through everything. Just had a question, is it possible to make it so If a player dies, flying is enabled? Want to make it so you turn into a ghost when you die. Keep it up!
@5uphi
@5uphi Жыл бұрын
thank you and to your question anything is possible
@LegendarySMR
@LegendarySMR Жыл бұрын
yo you just swimming in the air, pls add a different animation
@5uphi
@5uphi Жыл бұрын
Just keep swimming
@brennanmeader6252
@brennanmeader6252 6 ай бұрын
Im in the discord server and im still having trouble with this script and i want to copy it do i have to be a member in order to copy it?
@syntax3659
@syntax3659 2 жыл бұрын
So cool.
@clappingtoday7167
@clappingtoday7167 2 жыл бұрын
I’ve actually learnt a lot by watching your video and by using Roblox’s docs
@5uphi
@5uphi 2 жыл бұрын
It makes me very happy when people learn from my videos thanks for watching
@cosmiccal-hl7sl
@cosmiccal-hl7sl Жыл бұрын
How would I be able to have both inputs for controller and pc?
@5uphi
@5uphi Жыл бұрын
You can use the control module you can find how in the discord server inside the resources forum
@Caezarsworld
@Caezarsworld 2 жыл бұрын
what am i doing wrong? i typed everything in, and followed along with the video, but nothing is happening when i test.
@5uphi
@5uphi 2 жыл бұрын
if everything is like the video it will work so double check to make sure you never made a mistake if your still stuck message in the discord channel and ill take a look at what you have done
@Caezarsworld
@Caezarsworld 2 жыл бұрын
@@5uphi hey thanks for taking the time to respond Suphi. I figured out what it was after watchin the video over again. It was stuck at the 11 minute mark, it was an "end" missing off the screen after ContextActionResult. I couldnt see it once you typed it in but i will check out your discord. Thanks for your work!
@5uphi
@5uphi 2 жыл бұрын
:)
@Caezarsworld
@Caezarsworld 2 жыл бұрын
@@5uphi thank you, this is awesome I like the dynamics of your script. I am about to follow on Discord. Are you open to taking Cashapp donations for quick modifications to this fly script? Like I have an animation for when the player is idle in flight. So like a looped animation of the player jus hovering in place when at a complete stop in flight. But I’m pretty much a noob at scripting tho I completely understand how it works this is a learning curve for me
@itsmejhon
@itsmejhon Жыл бұрын
Hi can I request that you create a script for the gravity image button that when pressed the players will float and then when pressed, it will also stop? Thanks, I will wait for your comment
@5uphi
@5uphi Жыл бұрын
I only make tutorials not scripts for individuals
@itsmejhon
@itsmejhon Жыл бұрын
@@5uphi Thnx
@awezoro1744
@awezoro1744 Жыл бұрын
Cool video but I must have missed something because my alignment orientation always follows my upwards movement as well so whenever I’m moving up my character alignment rotates up as well. Plz help
@5uphi
@5uphi Жыл бұрын
Maybe your fly animation rotates the character simply remove the rotation from the align orientation
@awezoro1744
@awezoro1744 Жыл бұрын
@SuphiKanerDeveloper I didn’t get to the animation part I only got to around 32:14 which is when the flight stopped working, the setting the cframe of the align orientation is what messed me up even though looked through and Im pretty sure I copied the script exactly
@YourCertifiedGodDorito
@YourCertifiedGodDorito Жыл бұрын
yesss ty
@ahmaddaoud4605
@ahmaddaoud4605 Жыл бұрын
you think i can copy and paste the script?
@5uphi
@5uphi Жыл бұрын
checkout the discord channel in the description
@kowaighozt
@kowaighozt 2 жыл бұрын
I stumbled across your video to make a paraglider that has physics! Although similar concepts, do you think you'll release a tutorial for what I mentioned? :)
@5uphi
@5uphi 2 жыл бұрын
Yes I have plains to make a video showing how to make wing phisics that can be used for planes and paragliders
@kowaighozt
@kowaighozt 2 жыл бұрын
Great!!! Paragliders are a must for me, so maybe break them into two different parts for each segment! By the way, the video is outstanding and made me learn more about coding- so thank you!
@Moporto
@Moporto 2 жыл бұрын
Excuse me sir, where can i copy and paste the script?
@5uphi
@5uphi 2 жыл бұрын
Discord
@trynalearnpiano315
@trynalearnpiano315 2 жыл бұрын
I subscribed! ur content is so helpful!!!!
@5uphi
@5uphi 2 жыл бұрын
Thank you 😊 I'm happy it was helpful
@lakentrkfudge
@lakentrkfudge Жыл бұрын
I actually came here because this was one of the only sources I could find that explained why VectorForce has a vastly different effect depending on the player's avatar. In short, I have a script that uses VectorForce and AngularVelocity (both relative to the same Attachment) that basically makes the player act like an auto accelerating car that can steer in a circle. It works well but: I tried multiplying the Z value I put on VectorForce (which is 1000) by the HRP's assembly mass. Then I tried a heavy character with an assembly mass of 20.071 moves too slowly. And then I tried a really light character with an assembly mass of 4.507 moves way too quickly. If you know why, please help me out ( also if this sounds like a devforum question, it's because it basically is but i cant post on devforum yet :/ ) EQ: vectorForce.Force = Vector3.new(0, 0, 1000) * rootPart.AssemblyMass (drag is handled in a separate vectorForce)
@5uphi
@5uphi Жыл бұрын
Drag vector will also need to be multiplied by assemblymass
@lakentrkfudge
@lakentrkfudge Жыл бұрын
@@5uphiNow I have a really strange opposite effect. My light character gets stuck in place, and the heavier ones start drifting backwards since the drag is greater than the original vectorforce. I feel like it has to do with the equation and the fact that the main vectorforce and the drag vectorforce are separate forces. Do you know of an equation that's essentially both forces effect in one vectorforce, like the one in your video but it's made to work with vectorforce being relative to the RootRigAttachment and not the World? I could go about rewriting everything so that vectorforce is relative to the World, but then I wouldn't know how I could turn the character in the same circular motion without angularvelocity
@lakentrkfudge
@lakentrkfudge Жыл бұрын
Apparently, multiplying a character's assemblymass on VectorForce works the same for all players only if the player is in the physics state
@zzayuh
@zzayuh 2 жыл бұрын
Great content very helpful!
@5uphi
@5uphi 2 жыл бұрын
Glad it was helpful!
@flairflatly1801
@flairflatly1801 Жыл бұрын
Now tell me how to add a GUI for this
@5uphi
@5uphi Жыл бұрын
Inside starter gui add gui by pressing the + button
@alvarivoid6063
@alvarivoid6063 Жыл бұрын
It still won’t work for me
@5uphi
@5uphi Жыл бұрын
Double check your code to make sure you never made any mistakes
@gabrielgriffin2229
@gabrielgriffin2229 2 жыл бұрын
is there a way to implement this into an npc that can follow you in the air?
@5uphi
@5uphi 2 жыл бұрын
yes
@l.b.2949
@l.b.2949 Жыл бұрын
That is one of the greatest tutorials I ever saw, but unfortunally the trail could be seen only for the player itself, because its defined in the local script. I even tested this in Roblox Studio with two test players. And the trail can't be seen on the server and for other players.
@5uphi
@5uphi Жыл бұрын
Yes that's correct you could send a remote event when you enable and disable flight to the server to tell them to enable and disable the trail
@l.b.2949
@l.b.2949 Жыл бұрын
@@5uphi Thanks :3.
@guizoides9
@guizoides9 2 жыл бұрын
script?
@5uphi
@5uphi 2 жыл бұрын
Discord.
@envplayz
@envplayz Жыл бұрын
hi so when i run the action by pressing the key and in explorer everything seems to toggle and change but on the server it is not updated soo im guessing this has something to do with FilteringEnabled could u help should i choose remoteEvents for setting stuff or is it possible to disable filtering enabled?
@5uphi
@5uphi Жыл бұрын
everything is this video is client sided because the client has network ownership of there character we don't need to send any events to the server and the characters position and animations will get replicated to the server
@envplayz
@envplayz Жыл бұрын
@@5uphi alr so im guessing ill have to have an playeradded event on a server script and set networkownership to the player? do we just pass the player object or the name as a string?
@5uphi
@5uphi Жыл бұрын
Roblox will automatically give ownership of there character to the client you don't need to do it in a script its already done for you
@luciuslestrange2040
@luciuslestrange2040 2 жыл бұрын
how did you do the up arrow at 26:48 ???
@5uphi
@5uphi 2 жыл бұрын
I use a up arrow text character you can find them on the internet or you can just use a image
@sabharishrinivas4895
@sabharishrinivas4895 Жыл бұрын
Why are we doing -(math.pi) / 2 ?
@5uphi
@5uphi Жыл бұрын
check out this video kzbin.info/www/bejne/fqrGhXiMhdhonZY math.pi / 2 is 90 degrees
@sabharishrinivas4895
@sabharishrinivas4895 Жыл бұрын
@@5uphi thanks
@oo4278
@oo4278 Жыл бұрын
How do you make it so if the player is standing still while flying it looks up, so it has like a hover/idle effect?
@5uphi
@5uphi Жыл бұрын
I don't quite understand but you set the alignorientation.CFrame to rotate the character upright and you can also play a idle animation when the moveVector.Magnitude is 0
@trynalearnpiano315
@trynalearnpiano315 2 жыл бұрын
bruh your so helpful literally increasing my iq
@cooky3029
@cooky3029 Жыл бұрын
What will I earn if I subscribe to Patreon?
@5uphi
@5uphi Жыл бұрын
Nothing it's just a way to say thank you if I helped you
@oneoverall5100
@oneoverall5100 Жыл бұрын
Hi awesome video but I have a question, why don’t you add the area to the drag equation?
@5uphi
@5uphi Жыл бұрын
We are manully setting the drag amount and the drag value includes a fixed area
@oneoverall5100
@oneoverall5100 Жыл бұрын
and another question, why do you use AssemblyMass when the drag equation says density
@5uphi
@5uphi Жыл бұрын
Sorry I misspoke in the video. The density in the equation is the density of the air not the object when we set the drag variable it contains the density in that variable So what that means is local drag = 1 = (coefficient * density * referanceArea * 0.5) then we simply multiple the drag by the velocity squared local force = drag * velocity ^ 2 the reason we use AssemblyMass is to normalize the drag so that all players heavy or light get effected by the drag the same but in real life you would not multiply by the AssemblyMass but as I wanted all players to fly at the same speed that's why I added AssemblyMass
@artificialcreations2224
@artificialcreations2224 2 жыл бұрын
do you think you could try a iron man typa fly effect but with r6? this would really help me out as im working on a iron man project in roblox
@5uphi
@5uphi 2 жыл бұрын
Everything would be identical you would just change the animation and trail effect and maybe you would make the character go upright when you stop moving
@artificialcreations2224
@artificialcreations2224 2 жыл бұрын
@@5uphi oh ok thank you.
@Aritely
@Aritely 2 жыл бұрын
@@5uphi How can I make this please?
@Aritely
@Aritely 2 жыл бұрын
@@5uphi How do you make the character go upright if not moving?
@ayohaz6263
@ayohaz6263 2 жыл бұрын
I really love this. Could you make it serversided with the use of a remote event?
@5uphi
@5uphi 2 жыл бұрын
You could but why would you do that it would be very unresponsive and laggy
@ayohaz6263
@ayohaz6263 2 жыл бұрын
@@5uphi ah ok
@TorbjornIvarsson
@TorbjornIvarsson 2 жыл бұрын
can you make a admin panel tutorial? :)
@pepperdayjackpac4521
@pepperdayjackpac4521 2 жыл бұрын
Align orientation does not work when I set the humanoid state to physics. how do I fix this?
@5uphi
@5uphi 2 жыл бұрын
It should work there must be something else you missed from the video if you message me in discord I can try help you
@pepperdayjackpac4521
@pepperdayjackpac4521 2 жыл бұрын
@@5uphi Ah, I found my error. I forgot to make sure the CFrame of the orientation was set only if moveVector.Magnitude > 0. Could you explain why we need this check? Does it have something to do with the lookAt argument of CFrame.LookAt being v3(0,0,0) when the moveVector.Magnitude is 0? I tested this, and when the lookAt argument is v3(0,0,0) it just breaks, but I don't know why.
@5uphi
@5uphi 2 жыл бұрын
if you try to unit a vector3 that is 0, 0, 0 roblox will return nan, nan, nan and that will break the script so we make sure magnitude is more then 0 so we don't get nan, nan, nan
@pepperdayjackpac4521
@pepperdayjackpac4521 2 жыл бұрын
@@5uphi oh, I see now. Thank you!
@z1912.
@z1912. 2 жыл бұрын
Hello I have problem that the click button disappearing and in pc I can’t fly when I press f please say something!
@5uphi
@5uphi 2 жыл бұрын
If you message me in discord ill try my best to help
@z1912.
@z1912. 2 жыл бұрын
@@5uphi hello! I just redoing it and it’s working fine!!!!!!!!!! My user z1912 check the game :>>>
@z1912.
@z1912. 2 жыл бұрын
@@5uphi the problem is me I just did not focus on something I didn’t see, so I tryed to focus hard and it’s working check the game If u want I’m z1912
@z1912.
@z1912. 2 жыл бұрын
@@5uphi I wanted to delete the comment but I didn’t, I saw ur comment and I think I will keep this comment on the video, to make people focus on the script so there is nothing worng with it. Cuz there is nothing worng :)
@5uphi
@5uphi 2 жыл бұрын
:) if there are any big mistakes on the video I will delete the video but if there are small mistakes I will pin a comment saying the problem but this video has no problems to my knowledge
@eclipesassassin1633
@eclipesassassin1633 2 жыл бұрын
i had problems at if connection == nil then because the if always says it have error i did everything you did
@5uphi
@5uphi 2 жыл бұрын
if you post your code in discord id be happy to help you fix it
@jackedhat8069
@jackedhat8069 2 жыл бұрын
Subscribe to this guy he's awesome
Cars With Suspension - Roblox Scripting Tutorial
1:13:22
Suphi Kaner
Рет қаралды 79 М.
Stop Hackers / Exploiters - Roblox Scripting Tutorial
36:04
Suphi Kaner
Рет қаралды 51 М.
How To Get Married:   #short
00:22
Jin and Hattie
Рет қаралды 25 МЛН
Minecraft Creeper Family is back! #minecraft #funny #memes
00:26
Nastya and balloon challenge
00:23
Nastya
Рет қаралды 71 МЛН
Flight Physics - Roblox Scripting Tutorial
1:07:52
Suphi Kaner
Рет қаралды 43 М.
Content Streaming - Roblox Scripting Tutorial
29:24
Suphi Kaner
Рет қаралды 20 М.
How To EASILY Make Procedural Animations In Roblox
6:46
Prototype culling system
1:17
Haoblox2006
Рет қаралды 3,1 М.
Linked List / Signals - Roblox Scripting Tutorial
1:52:56
Suphi Kaner
Рет қаралды 10 М.
I Oversimplified Famous Games
12:41
PolyMars++
Рет қаралды 25 М.
Slice / Cut Parts - Roblox Scripting Tutorial
1:10:29
Suphi Kaner
Рет қаралды 64 М.
How To Get Married:   #short
00:22
Jin and Hattie
Рет қаралды 25 МЛН