How to make a 3D Flying Controller in Unity

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 มิ.ย. 2024
  • In this video I will show you how to make a simple flying controller inside unity. Hope you enjoy it.
    ----------------------------------------------------------------------------------------------------------
    ●Project Source: github.com/OcelotDevelop/Spac...
    ●NASA's article about Dynamics of Flight: www.grc.nasa.gov/www/k-12/UEE...
    ●Xbox and Playstations Controller Mapping: bit.ly/2O1LET0
    ----------------------------------------------------------------------------------------------------------
    ●Support me on Patreon: / ocelotdev
    ●Subscribe: bit.ly/3t8t2Qb
    ●Twitter: / emilioblacksmit
    ●Instagram: / emilioblacksmith
    ----------------------------------------------------------------------------------------------------------
    Music.
    ●Arcade - Lakey Inspired - / arcade
    ●Chill Day - Lakey Inspired - / chill-day
    ●Warm Nights - Lakey Inspired - / warm-nights
    ●Lo-fi Type Beat - beach - / free-lo-fi-type-beat-b...
    ----------------------------------------------------------------------------------------------------------
    Chapters:
    ● 00:00 Intro
    ● 00:18 Explanation
    ● 01:12 Tutorial
    ----------------------------------------------------------------------------------------------------------
    #tutorial #unity3d #gamedev #madewithunity

ความคิดเห็น • 43

  • @MadMarcWinnipeg
    @MadMarcWinnipeg 2 ปีที่แล้ว +1

    Hell yeah. That was perfect to get me started.
    Thanx
    Marc :)

  • @fricknfrackgames6558
    @fricknfrackgames6558 2 ปีที่แล้ว +1

    Nice! Well done!

  • @sophiayuna
    @sophiayuna 2 ปีที่แล้ว

    This was a great video thanks for sharing

  • @christopheremerson2848
    @christopheremerson2848 ปีที่แล้ว

    Excellent script. Very straight forward and customizable control scheme. Thank you.

    • @EmilioBlacksmith
      @EmilioBlacksmith  ปีที่แล้ว

      And it can be updated with the new input system, thanks for watching the vid, and your comment!

  • @jawaherhalsefri7433
    @jawaherhalsefri7433 2 ปีที่แล้ว

    Thank you so much great video 💛💛

  • @McDonaldsSprite247
    @McDonaldsSprite247 ปีที่แล้ว +2

    thank you

  • @G33kFr33k
    @G33kFr33k 2 ปีที่แล้ว +2

    The only thing I would change is that you do not need to multiply values for yaw, pitch, and roll with their power and Time.deltaTime twice. You did it initially when determining activePitch, activeYaw, and activeRoll. You did not need to do it during the transform.Rotate().

    • @EmilioBlacksmith
      @EmilioBlacksmith  2 ปีที่แล้ว

      Oh lord, you're right, thanks for the feedback, my man

    • @jigarpanchal0
      @jigarpanchal0 ปีที่แล้ว

      @@EmilioBlacksmith 0:16 how did you make the spacehip bro specifically the lighting it emits how did you make that I did actually downloaded free asset from itch io but the thrust light and some other lights are not showing and I don't even know how to add them

  • @magikarpsushi1973
    @magikarpsushi1973 3 ปีที่แล้ว +3

    Pretty useful... do you think this good be manipulated for use on a hot air balloon? - obviously a balloon as rather different flight mechanics
    Any chance you'd be whiling to assist with something like this?

    • @EmilioBlacksmith
      @EmilioBlacksmith  3 ปีที่แล้ว

      Hey mate, it is an interesting request, you could use my flight system and change its core, and use, for example, the hot air balloon uses burners to increase or decrease the height, and it could work like the throttle lever of the airplanes. The Only thing I think it would change a lot is that we need to use rigidbody to simulate the physics of the hot air balloon, and the falling, changing of course some of the values of the balloon.
      And in the case of the yaw and roll, we don't have those in this case, we can use de horizontal and vertical values to move in the x and z axis of the balloon. I don't think there's an easy way to explain this changes, so if you want to I could make the tutorial on how to make an Hot Air Balloon, and as soon as I have the code for it, I'll send it to you, so you will not wait that much for yours to work.
      Hope this big comment was useful for you, and I'll make a video about it soon, maybe in two weeks, hopefully

    • @G33kFr33k
      @G33kFr33k 2 ปีที่แล้ว

      Emilio is correct.
      Also, when using a rigidbody, you can adjust the drag coefficient to reduce the effect of gravity as well as the mass. When applying force to the rigidbody of the balloon you would only need to do so in one direction, and would want to use impulse.
      rigidbody.AddForce(Vector3.up * thrustAmount, ForceMode.Impulse);
      You lower the balloon by releasing stored hot air through a flap in the balloon, which could also be simulated through the same method.
      rigidbody.AddForce(Vector3.down * releaseRate, ForceMode.VelocityChange);

  • @Jaysiah360
    @Jaysiah360 2 ปีที่แล้ว

    great vid but i have a problem with my plane when it moves, it moves in lets say frames like instead of smooth it just skipps to an angle

  • @bfk9636
    @bfk9636 2 ปีที่แล้ว

    Could you make a video about plane's take-off and land,it will be much interesting to learn it😀

    • @EmilioBlacksmith
      @EmilioBlacksmith  2 ปีที่แล้ว

      Maybe one day, right now I’m more focus on making my first videogame an isometric videogame named frostbite

  • @jigarpanchal0
    @jigarpanchal0 ปีที่แล้ว +1

    0:16 how did you make the spacehip bro specifically the lighting it emits how did you make that I did actually downloaded free asset from itch io but the thrust light and some other lights are not showing and I don't even know how to add them

    • @EmilioBlacksmith
      @EmilioBlacksmith  ปีที่แล้ว +1

      Sorry for the late response!
      For the emission of my spaceship I added a post processing volume to the scene with bloom effect and added emission to the material of the lights of the spaceship, check this video out, it's what I did to give the glowing of the spaceship: th-cam.com/video/2PBgCl-zIZQ/w-d-xo.html

  • @Hyphen3372
    @Hyphen3372 2 ปีที่แล้ว +1

    hey can you help for some reason when ever i turn 180 degreese on the z axis then my pitch isnt inverted.

    • @EmilioBlacksmith
      @EmilioBlacksmith  2 ปีที่แล้ว

      Sure, are you using the same code from the video?

  • @sivasree9897
    @sivasree9897 2 ปีที่แล้ว

    I have a problem
    Assets/SpaceshipMovement.cs(8,23): error CS1644: Feature `expression bodied members' cannot be used because it is not part of the C# 4.0 language specification
    please help me

  • @jodyclemons4235
    @jodyclemons4235 8 หลายเดือนก่อน

    I am getting an Error CS0117 : Space' does not contain a definition for self

  • @DavidAdochiti
    @DavidAdochiti 3 ปีที่แล้ว +1

    how can i make it so that once u press space, u go on forever and then when u press space again u stop? Thanks! :D

    • @EmilioBlacksmith
      @EmilioBlacksmith  3 ปีที่แล้ว +1

      Hey mate, I just made a new version just for you, using the spacebar as the throttle lever, in summary, you should make another boolean variable that will change according on the pressing or if you press again, this is the link for the code, to make it easier to you, hope this was helpful: github.com/OcelotDevelop/SpaceshipController/commit/139ddd820388f5f5c88edec71f2c806f947e1cc7

    • @DavidAdochiti
      @DavidAdochiti 3 ปีที่แล้ว

      @@EmilioBlacksmith thanks a lot! u have no idea how much this means to me :D

    • @EmilioBlacksmith
      @EmilioBlacksmith  3 ปีที่แล้ว +1

      @@DavidAdochiti it is a pleasure for me to be helpful

  • @HX-uq2gr
    @HX-uq2gr 3 ปีที่แล้ว +1

    There is only ohne Problem the plane is not tuning when rolling like it normally would.

    • @EmilioBlacksmith
      @EmilioBlacksmith  3 ปีที่แล้ว

      would you want to contact me by email, to see your project and try to help you?

    • @HX-uq2gr
      @HX-uq2gr 3 ปีที่แล้ว

      @@EmilioBlacksmith That’s so nice of you what’s your address?

    • @EmilioBlacksmith
      @EmilioBlacksmith  3 ปีที่แล้ว

      @@HX-uq2gr OcelotDev@outlook.com

  • @pro_idott9328
    @pro_idott9328 2 ปีที่แล้ว

    I have a problem when I use the code I dont have control of the plane at all only thing I have control of is the throttle

    • @pro_idott9328
      @pro_idott9328 2 ปีที่แล้ว

      specifically I mean unity is saying there's a error with my input even though I set it up just like yours

    • @EmilioBlacksmith
      @EmilioBlacksmith  2 ปีที่แล้ว

      @@pro_idott9328 Could you send here the error displayed on the editor console?

  • @ghostriderxzx
    @ghostriderxzx 3 ปีที่แล้ว +1

    Rico

  • @sahilpalandurka7251
    @sahilpalandurka7251 2 ปีที่แล้ว

    Can u go for touch controls

    • @EmilioBlacksmith
      @EmilioBlacksmith  2 ปีที่แล้ว +1

      Sure, I'll made a video on touch controls, and will ping you once it's available, meanwhile you could use brackey's tutorial on it: th-cam.com/video/bp2PiFC9sSs/w-d-xo.html

  • @jodyclemons4235
    @jodyclemons4235 8 หลายเดือนก่อน

    ok I got it fixed

  • @bernardmacdonagh9517
    @bernardmacdonagh9517 2 ปีที่แล้ว

    to you have one on Helicopter?

    • @EmilioBlacksmith
      @EmilioBlacksmith  2 ปีที่แล้ว

      I’m sorry, not yet, I’ve been focusing on making my big game instead of making more tutorials

  • @jodyclemons4235
    @jodyclemons4235 8 หลายเดือนก่อน

    now my ship keeps spinning when I press a button
    HELP Please ...Thank you

  • @Ledieuchat
    @Ledieuchat 2 ปีที่แล้ว +1

    were is a code ?? send link bro

    • @EmilioBlacksmith
      @EmilioBlacksmith  2 ปีที่แล้ว

      github.com/OcelotDevelop/SpaceshipController/blob/main/FlyingMovement/Assets/Completed/Scripts/SpaceshipController.cs here you have it, mate

  • @jodyclemons4235
    @jodyclemons4235 8 หลายเดือนก่อน

    HELP !!!