Thanks for this, the simplicity was helpful. I'm not an aeronautics guy either, but if I may, your lift vector should be perpendicular to the direction of air moving over the wing, although you can simplify that in this situation to just be perpendicular to the wing. So the lift is applied in the direction of rb.up instead of Vector3.up. Cheers!
@@b3agz (And just to beat this dead horse a bit more...) This will give you a much more realistic feel to the flight. If flying straight and level at a given speed, it means your lift is perfectly counteracting gravity. Then, when you bank, the lift is no longer perfectly opposed to gravity, so the nose will start to drop in the bank (the center of gravity may need to be forward of the center of lift to see the drop. At a minimum, you'll see the direction of flight vector drop below the horizon, anyway!) To counteract this dropping of the nose during the bank, you pull back on the stick to level out your flight. But since your lift vector is tilted, part of the effect of pulling back on the stick is that you turn horizontally... And this is primarily what causes you to turn during a bank! (I think the rudder contributes some, but I'm not sure it's as much). Any pilots or aeronautics guys please jump and and correct me if I'm wrong. Thanks!
Really struggling with this and would love some help, followed everything but my plane goes to the side when I press space, ive tried rotating my plane, camera etc.. the only way I get it going forward my plane is one its side haha.. also my pitch and roll are reversed, I've made sure the input settings are correct. Thanks in advance for any help!
Excellent tutorial. Easy to follow and simple to understand. There appears, however, to be a problem with lift - which is to say that there is none :p I altered the lift value at runtime to see if I could change the minimum airspeed threshold for takeoff, but it took not at 240f, but at over 200 million - at which point it accelerated upward at an exponential rate so ludicrous as to take me to the physically-based sky's planet view in HDRP. I may have done something wrong lol
This is truly amazing. I recently spent about a month trying to make a physics plane controller in unity but ended up with a buggy mess. I can't belive this was here all along. Keep up the great work!
Where did the 3.6 magic number come from when displaying airspeed? Physics operates in the same standard units, so the velocity of the rigid body should already be in m/s.
Hi! Yes, if we use 1 unit to be 1 metre, we're already in in metres per second. The 3.6 number is convert our m/s to km/h. 60 seconds in a minute multiplied by 60 minutes in an hour = 3,600 metres per hours. Divide by 1,000 = 3.6 kilometres per hour.
I usually update camera's position in the LateUpdate loop, I think that you could still get jitter and interference if updating it together with the rest of the physics objects
I'm having trouble with the orientation of my model aircraft's local axes. They are different from the global axes, and when I apply a roll input, it generates pitch instead. I want to adjust the local axes' orientation so that roll input generates roll, not pitch. How do I do that? I am importing the aircraft into a new scene, not the built-in that comes with the asset.
I dont know if you ever solved this. but just double check your inputs. for me the alt inputs for yaw and pitch were the same so both yaw and pitch were essentially being activated at the same time. Hope this helps
@@gamesscow2382 Thank you for the reply. I solved it by creating a new scene where the world axes were the same direction as aircraft axes. I had no trouble with alt inputs. Another way to solve this issue is to create a new coordinate system and making the aircraft its child object. But it increases code complexity and that's why I decided to go with the first approach.
@@rehmozayub9442 You could put the plane into an empty object with all of the code on that object then just rotate the plane to the correct orientation
@@gamesscow2382 yes that's what I meant in the last reply but it was creating some complications (I don't remember what exactly) and I took the easier way out.
Thanks for the lesson he’s great! 😍 You can make the physical material and put it in the collider, the fields will be put at zero, friction combine: minimum, and then your plan will normally move on the ground
PRO TIP: Use Cinemachine for the camera. Step 1: Put Cinemachine in project Step 2: Create Virtual Camera Step 3: Make it look at a new parent for the plane, but follow the plane Step 4: Adjust viewing Step 5: Enjoy working cinematic camera
Hi there, I'm stuck :( Have copied the code exactly (I hope) no errors when I drag and drop onto my model. However, there's no movement of the model as at 10:00. It's like the input controller isn't being recognised. Any ideas? Thanks
Hi. We control the plane with 1-100 "throttle" value, it's basically a percentage of the engine force. To make it go faster, increase the engine force.
Thanks for this, the simplicity was helpful. I'm not an aeronautics guy either, but if I may, your lift vector should be perpendicular to the direction of air moving over the wing, although you can simplify that in this situation to just be perpendicular to the wing. So the lift is applied in the direction of rb.up instead of Vector3.up. Cheers!
Thanks! I'll pin this so others can see it.
@@b3agz (And just to beat this dead horse a bit more...) This will give you a much more realistic feel to the flight. If flying straight and level at a given speed, it means your lift is perfectly counteracting gravity. Then, when you bank, the lift is no longer perfectly opposed to gravity, so the nose will start to drop in the bank (the center of gravity may need to be forward of the center of lift to see the drop. At a minimum, you'll see the direction of flight vector drop below the horizon, anyway!) To counteract this dropping of the nose during the bank, you pull back on the stick to level out your flight. But since your lift vector is tilted, part of the effect of pulling back on the stick is that you turn horizontally... And this is primarily what causes you to turn during a bank! (I think the rudder contributes some, but I'm not sure it's as much). Any pilots or aeronautics guys please jump and and correct me if I'm wrong. Thanks!
It was a *simple* plane controller 😂
@@b3agz ha ha, sorry :)
I've tried it, but Rigidbody doesn't have a property for up. Any suggestions?
I would love to see this develop along with a physics based boat with bouyancy and a physics based helicopter. Great work!
Me, too!
Awesome video, loved the audio, your voice is crisp and clear, and your accent is flawless. Thanks for the guide!
pov: war thunder alpha 0.0.1
Really amazing and useful tutorial. It helped a lot creating my plane controller. Thanks!
Great to hear!
Thank you for this excellent tutorial. It was exactly what I was looking for, and was clearly explained.
Glad it helped!
Thanks for this b3agz!
Would love to see your take on a physics based boat controller with water!
I've had a few requests for that so yeah, it's on the list 🤓
@@b3agz Could you also add a physics based helicopter too ;), there arent many tutorials based on helis and if there are they seem to be years old.
Really struggling with this and would love some help, followed everything but my plane goes to the side when I press space, ive tried rotating my plane, camera etc.. the only way I get it going forward my plane is one its side haha.. also my pitch and roll are reversed, I've made sure the input settings are correct. Thanks in advance for any help!
Muchas Gracias por el tutorial esta increíble, ayudaste mucho a un amigo mexicano :)
Ah thanks for the tutorial! Was looking for something like this :D
Hey CptFurball, welcome! And thanks, glad people are finding it useful.
Excellent tutorial. Easy to follow and simple to understand. There appears, however, to be a problem with lift - which is to say that there is none :p I altered the lift value at runtime to see if I could change the minimum airspeed threshold for takeoff, but it took not at 240f, but at over 200 million - at which point it accelerated upward at an exponential rate so ludicrous as to take me to the physically-based sky's planet view in HDRP. I may have done something wrong lol
can you make the plane script copy paste? it doesnt work for me
My plane can pitch but the yawning and rolling are not working. The input of yaw and roll are perfectly recognized though. Any idea?
this is a more complicated physical plane controller toturial i made;
th-cam.com/video/vpf4QnWO20c/w-d-xo.html
I get an error (42,32): Operater '.' cannot be applied to operand of type 'void'. Any help ?? thanks
Im having a issue where the plane has like a weird physics drift effect, any advice?
Any idea how to make the plane less responsive at high speeds?
Tried adding rb.velocity.magnitude as component for rb.torque but didn't work☹
movement * multiplier float
lower multiplier if higher speed
THX
YR WELCME
Wow!!!
can u share the script
I HAVE COPIED THE CODE TO EXACT BUT NOTHING WORKS
This is truly amazing. I recently spent about a month trying to make a physics plane controller in unity but ended up with a buggy mess. I can't belive this was here all along. Keep up the great work!
Amazing tutorial, btw this airplane model reminds me of the Zero's mission in GTA San Andreas.
Where did the 3.6 magic number come from when displaying airspeed? Physics operates in the same standard units, so the velocity of the rigid body should already be in m/s.
Hi! Yes, if we use 1 unit to be 1 metre, we're already in in metres per second. The 3.6 number is convert our m/s to km/h. 60 seconds in a minute multiplied by 60 minutes in an hour = 3,600 metres per hours. Divide by 1,000 = 3.6 kilometres per hour.
I usually update camera's position in the LateUpdate loop, I think that you could still get jitter and interference if updating it together with the rest of the physics objects
This fixed my jitters thanks🙌
Great tutorial. I wish you added some breaks to the plane .
loved the tutorial, much appreciated
I'm having trouble with the orientation of my model aircraft's local axes. They are different from the global axes, and when I apply a roll input, it generates pitch instead. I want to adjust the local axes' orientation so that roll input generates roll, not pitch. How do I do that? I am importing the aircraft into a new scene, not the built-in that comes with the asset.
I dont know if you ever solved this. but just double check your inputs. for me the alt inputs for yaw and pitch were the same so both yaw and pitch were essentially being activated at the same time. Hope this helps
@@gamesscow2382 Thank you for the reply. I solved it by creating a new scene where the world axes were the same direction as aircraft axes. I had no trouble with alt inputs. Another way to solve this issue is to create a new coordinate system and making the aircraft its child object. But it increases code complexity and that's why I decided to go with the first approach.
@@rehmozayub9442 You could put the plane into an empty object with all of the code on that object then just rotate the plane to the correct orientation
@@gamesscow2382 yes that's what I meant in the last reply but it was creating some complications (I don't remember what exactly) and I took the easier way out.
This is such a good tutorial and explanation! You are like the new brackeys or something, i really like your teaching style! Keep it up!
thanks for this perfect, best, simplest and easy to understand tutorial.
Thank you!, this is the best tutorial
My plane keeps moving to the side when i tell it to go forward using the up arrow, i have no idea why.
try to increase mass in rigidbody
thank you i was makeing a game for my brother cause he's a piolit and your video helped me alot(:
Hi friend, could you help me? Because my plane, even with the Throttle at 1%, has 1000KM\h, how can I solve this?
Amazing people like you are what allows nobodies such as myself live out my dreams of making my own flight sim.
10:26
im having a problem where i nose dive intentionally and lost airspeed and when i point my nose up the airspeed increases. kinda weird. anyone help?
What about Gamble lock? How would you deal with that?
thanks for the tutorial, but is there any way of using mouse control to move the plane left or right? thank you.
it gave me errors when i tried it and I spent hours trying to fix it can anyone reply to this and past a code that works?
How can I get that auto complete mine is frustrating I'm using the unity auto complete.
Thanks a lot, it does the job very well !
Love the detailed tutorial :D
Hey, so when I do a 180 turn the plane just flys in the direction it flew how to fix it?
Aeronautic wise, this is ridiculous(ly fun). But for me a beginner in unity, this was gold
what is additional camera data script
Thanks for the lesson he’s great! 😍 You can make the physical material and put it in the collider, the fields will be put at zero, friction combine: minimum, and then your plan will normally move on the ground
Great tip!
PRO TIP: Use Cinemachine for the camera.
Step 1: Put Cinemachine in project
Step 2: Create Virtual Camera
Step 3: Make it look at a new parent for the plane, but follow the plane
Step 4: Adjust viewing
Step 5: Enjoy working cinematic camera
This tutorial was so good. Clearly explained, calm, and funny too! Well done :)
Thanks so much!
Hi there, I'm stuck :( Have copied the code exactly (I hope) no errors when I drag and drop onto my model. However, there's no movement of the model as at 10:00. It's like the input controller isn't being recognised. Any ideas? Thanks
same
did you solve it?
Whoa, another vid, and so soon?!
Thanks!
MOOOOOOOOREEEE VIDEOOOOS
amazing
nice
Genius.
Thank you!
You're welcome!
Bold of you to assume that im not a pilot.
I assume you are everything 🥹
@@b3agz well you were right im not a pilot 😌
lol
My plane is to slow
Hi. We control the plane with 1-100 "throttle" value, it's basically a percentage of the engine force. To make it go faster, increase the engine force.
@@b3agz ok thanks
Please give link for script
First?
It appears you are.
is there a download link for the script? I understand it but i dont want to type the whole thing out
what is alpha1/2/3/4
nvm found it