How to make a Homing Missile in Unity with Trajectory Prediction (source included)

Поділитися
Вставка
  • Опубліковано 25 січ 2022
  • Homing missiles are fun as hell, so let's make one. This rocket will predict future motion using velocity. We'll also use cosine to make the rocket trajectory more interesting.
    Make sure you leave a like on the video if you enjoyed it :)
    Source: github.com/Matthew-J-Spencer/...
    Effects not included. They can be found here: assetstore.unity.com/packages...
    ❤️ Become a Tarobro on Patreon: / tarodev
    =========
    🔔 SUBSCRIBE: bit.ly/3eqG1Z6
    🗨️ DISCORD: / discord
    ✅ MORE TUTORIALS: / tarodev

КОМЕНТАРІ • 119

  • @auckzsv8599
    @auckzsv8599 2 роки тому +39

    This video shows a great combination of design and technique, in such a stylish way.

  • @YasserSedrati
    @YasserSedrati 2 роки тому +2

    Straight to the point! Love your short videos.

  • @DanPos
    @DanPos 2 роки тому +2

    Simple and to the point, cracking stuff Tarodev!

  • @Asjagadra
    @Asjagadra 2 роки тому +14

    I discovered you since only a month ago, but I am impressed that you are not more knowned from the community. All your videos are amazing! They are a great mix of a good idea with a clever implementation, it is well and clearly described and always visually pleasing. This new one illustrates that really well! Thank you for your work, I will spread the word and I hope you'll rise in fame because you deserve it!

  • @fisekoo
    @fisekoo 2 роки тому +6

    you are amazing Taro. I really like your videos and tutorials, it really helps me a lot. Keep it up!

  • @Spreadmouse
    @Spreadmouse 2 роки тому +105

    Taro, i really love your high quality simple and short tutorials. You make even better tutorials than brackeys, if you keep it up you will maybe be the new brackeys

    • @Tarodev
      @Tarodev  2 роки тому +19

      Damn... thanks man

    • @zelos666
      @zelos666 2 роки тому +7

      @@Tarodev I agree. I can't overstate how long I've been looking for something that goes beyond the absolute basics. And you're presenting these topics in a way that actually makes it really easy to implement them in your own game.

    • @RalphH007
      @RalphH007 2 роки тому +3

      Woah woah woah, that is heresy ;)

    • @Tarodev
      @Tarodev  2 роки тому +6

      @@RalphH007 brackeys, our lord and saviour

    • @ragerungames
      @ragerungames 2 роки тому +2

      man to be very honest I was thinking the same today. Brackeys is good for beginners but Tarodev is good for beginners and intermediate / advance :D
      Tarodev = Brackey^2
      I don't know if Taro started his channel right after Brackeys quit

  • @PixelbugStudio
    @PixelbugStudio 2 роки тому +3

    Loved these small videos. We need more of these.

  • @hegworks
    @hegworks 2 роки тому +3

    The Unity community should be glad and proud that has such geniuses like you.
    Keep it up bro!

  • @tomazznidarko8700
    @tomazznidarko8700 2 роки тому +2

    Thank you once again for your contribution to Unity community. It really helps a lot to learn for beginners like me.

  • @neipo
    @neipo 2 роки тому +3

    Always looking for a non-beginner tutorial on doing something specific in a concise manner. This channel does even better by being incredibly well produced as well. Channel trajectory pointing straight upward. Long as there are as many people as I suspect are ready to step past the line by line tutorial. (plus full source available? wildly great stuff)

  • @bluzenkk
    @bluzenkk 2 роки тому +2

    Coincidently, I was researching how to make homing missile yesterday and today I see you just made a video on it.
    As if you read my mind from miles away.

  • @DynastySheep
    @DynastySheep 2 роки тому +1

    Best content out there, quick and straight to the point.

  • @nielsbckx8439
    @nielsbckx8439 2 роки тому +2

    Great content and visuals for a one and a half minute video 👍 Love

  • @RainDevs
    @RainDevs Рік тому

    I finally found someone who knows exactly what they're talking about and can teach it in a simple incredible way! You are very talented!

  • @marcelboersma
    @marcelboersma 2 роки тому +2

    Awesome video man! Thanks for your excellent content.

  • @jacktruong7151
    @jacktruong7151 Рік тому +1

    U really saved my day

  • @KifDawg
    @KifDawg Рік тому +3

    the perfect tutorial

    • @Tarodev
      @Tarodev  Рік тому +1

      The perfect viewer ♥

  • @tylerheenan9393
    @tylerheenan9393 2 роки тому

    Been a Unity dev for 6 years and your content has to be some of the absolute best on UA-cam.

  • @ASouza-ut9kb
    @ASouza-ut9kb 10 місяців тому +1

    Ultra high level video! Thanks dude.

  • @sapientunderground
    @sapientunderground 2 роки тому +1

    Nifty, I look forward to making use of this.

  • @Tharky
    @Tharky 2 роки тому +3

    Another great tutorial, can easily be remade in 2D as well with the logic💙

  • @TackleProd
    @TackleProd 2 роки тому +1

    Really cool, especially the reaction time based on distance. Going to implement this in 2D later :)

  • @jiataosu7846
    @jiataosu7846 2 роки тому

    Your work is amazingly professional for how little views you get! I think eventually you will get the recognition you deserve!

  • @pa_de_queijo
    @pa_de_queijo 2 роки тому +1

    Great! Very simple and practical!

  • @truth8483
    @truth8483 2 роки тому +1

    wow that is so cool! Thanks a bunch!!

  • @NowKnownMAWO
    @NowKnownMAWO 2 роки тому

    Like always a little but powerfull tutorial :) Thanks a lot!

  • @ScrewY0UguyS
    @ScrewY0UguyS 2 роки тому

    This is perfect tutorial. Thanks!

  • @qiangpanchen6785
    @qiangpanchen6785 2 роки тому +1

    nice! I could imagine using this to create a shoot and run game :))) Thank you!

  • @AliRavencoreAdam
    @AliRavencoreAdam 6 місяців тому

    This is awesome!

  • @rize2137
    @rize2137 2 роки тому +1

    Gorgeous!

  • @alextreme98
    @alextreme98 Рік тому

    So cool, nice tutorial 😁

  • @bradb5129
    @bradb5129 Рік тому +1

    this is prolly the best made tutorial i’ve ever seen

  • @iamgruff
    @iamgruff 2 роки тому +1

    Brackeys 2.0 Plus - love your work bossman. Thanks for the inspirations🍺

  • @raoulbest5395
    @raoulbest5395 2 роки тому +6

    This is amazing! You've struck a perfect balance between visual quality, code amout and video speed and duration.
    unfortunatly youtube does not like small particles and even in 1080p the video was quite blocky

    • @Tarodev
      @Tarodev  2 роки тому +1

      Yeah man, tell me about it. YT ripped it to shreds :( Partly my fault for the vignette. Live and learn!

  • @krissloo143
    @krissloo143 2 роки тому +1

    Yet again, me thinking I got perfect missiles only to see this awesome cosine feature :)
    You rock!

    • @Tarodev
      @Tarodev  2 роки тому

      You could also add sin on the Y axis for a full circle rotation. That'd look cool :)

  • @AetherXIV
    @AetherXIV Рік тому

    perfect for my project. ty

  • @samochreno
    @samochreno 2 роки тому +1

    best unity channel rn

  • @octe-es
    @octe-es 2 роки тому +2

    Tarodev I really love u ❤️ great tutorial!

  • @castlecodersltd
    @castlecodersltd Рік тому

    Excellent, thanks ☺

  • @ultimatebluegrassplaylistc3087
    @ultimatebluegrassplaylistc3087 2 роки тому +1

    Totally awesome

  • @thepralad1484
    @thepralad1484 2 роки тому +1

    wow tarodev new vid!

  • @guyabikhair7066
    @guyabikhair7066 2 роки тому

    The most underrated channel on youtube

  • @brodendangio4810
    @brodendangio4810 2 роки тому +1

    @Tarodev - You're a rocket, these tutorials are engine fuel, and your channel is headed to the Moon!

  • @Jamie_Gamedev
    @Jamie_Gamedev 2 роки тому +1

    I can’t wait until we see game mechanics in them satisfying trend videos.

  • @fulongfromthegrave
    @fulongfromthegrave 2 роки тому +1

    Excellent content! Love the production value added by the terrain and audio... where did you get these trees?? 🤣🤣

    • @Tarodev
      @Tarodev  2 роки тому

      I think I grabbed them from a bunch of places. I'm using the same project as my Find Life video, so I just cherry picked random stuff left over 😜

  • @hpchannel5463
    @hpchannel5463 Рік тому

    Awesome video. I would love to know more about the camera script.

  • @fredimachadonet
    @fredimachadonet 2 роки тому +1

    Awesome content! Thanks! Do you have a tutorial for the wind particles/trails that appear occasionally ? It looks really good.

    • @fredimachadonet
      @fredimachadonet 2 роки тому +1

      Oh nvm, I think it's from the Epic Toon Fx asset. Thanks!

  • @thricemindblown7883
    @thricemindblown7883 Рік тому +1

    What a convenient and digestible video.

    • @Tarodev
      @Tarodev  Рік тому

      Hope it helped ❤️

  • @youcancallmedoggie
    @youcancallmedoggie 2 роки тому +1

    Danke!!

  • @ikenna2058
    @ikenna2058 Рік тому

    Please can you make a video on how you make your game graphic look soo good, btw love your videos

  • @kennisdev
    @kennisdev 2 роки тому +1

    you's awesome :0

  • @mayankbhaisora2699
    @mayankbhaisora2699 2 роки тому +1

    Wow man

  • @homemacai
    @homemacai 2 роки тому +1

    Noice!

  • @johnanthony44
    @johnanthony44 2 роки тому +1

    Thank you for this! Can you make a tutorial on creating turrets that can fire at a target in motion with variable speed projectiles?

  • @datablob
    @datablob 2 роки тому +1

    That intro 😍

    • @Tarodev
      @Tarodev  2 роки тому

      I knew you'd love it blobby

  • @rapaltiar
    @rapaltiar 2 роки тому

    Could you give a little more explanation regarding prediction?! Gr8 video though!

  • @user-cu5ky8qz2n
    @user-cu5ky8qz2n 2 роки тому +2

    💣

  • @lukaspichler1264
    @lukaspichler1264 2 роки тому +1

    really cool video!!! how would you implement that the missile dodges terrain?

    • @Tarodev
      @Tarodev  2 роки тому +1

      I'd normally say you wouldn't fire a missile at terrain in real life so it's probably not required, but I would send raycasts forward and when ground is detected skew away from it.

  • @kamienel9941
    @kamienel9941 2 роки тому +3

    Nice video I would like to point 2 things putting code below the video is making it harder to see for people using subtitles and the audio volume of this video seems a little off

    • @Tarodev
      @Tarodev  2 роки тому +3

      Ohhhhh!! Good point. Damn... I'll try remember that for next time

  • @sickboi11111
    @sickboi11111 2 роки тому +1

    Nice video!
    How do you record the output from unity?
    Do you just use a screen recorder like OBS?

    • @Tarodev
      @Tarodev  2 роки тому +1

      Unity video recorder. Official plugin :)

  • @NguyenNgoc-kr9ux
    @NguyenNgoc-kr9ux 2 роки тому +1

    Hi, can you make a video about script performance optimization pls, thanks

  • @t83245
    @t83245 Рік тому

    S500 missile game the best

  • @iiropeltonen
    @iiropeltonen 2 роки тому

    Your videos are usually extremely clear. While this was fairly simple I found this format more difficult to follow.

  • @negus3530
    @negus3530 9 місяців тому

    Hello! I have a problem with my missile. When the target evades and stays still, the missile just does circles around it orbit like behaviour, is there any name for this? because i cannot search any fixes for this

  • @wortwortwort117
    @wortwortwort117 Рік тому

    How can we allow the homing missles to work after being instantiated?

  • @walney2008
    @walney2008 Рік тому

    hello, can you teach how to configure a helicopter and have a sight to launch rockets on it?

  • @sidremus
    @sidremus 2 роки тому +2

    Excellent and concise video! A small follow-up question: how'd I make it so the rocket does more of a roll and pitch movement? Is there a way to define an "up" for this method so? Then it would make for very nice airplane like flight behavior

    • @Tarodev
      @Tarodev  2 роки тому

      Do you mean circular noise instead of jus horizontal? Adding Mathf.Sin to the Y deviation should do the trick.

    • @sidremus
      @sidremus 2 роки тому

      @@Tarodev no, more like the flight behavior of an airplane where you'd first roll so top's facing the target and then pitch up.

    • @libberator5891
      @libberator5891 2 роки тому +1

      @@sidremus There's probably better ways to achieve that, but here's my idea:
      1. Get the targetDirection vector (targetPos - projectilePos). You could use _standardPrediction or _deviatedPrediction instead of targetPos to better match your other rotations.
      2. Do a dot product between the targetDirection and your projectile's transform.right vector: if it's positive, lean/rotate right; if it's negative, roll to the left (adding degrees to your z rotation, assuming z is your projectile's forward vector)
      Note: if the target is directly to the right, the dotproduct will be 1. Directly to the left will be -1. Directly in front, behind, above, and below will be 0, so you'll have to work out the rest but it's an idea to get you started

    • @midniteoilsoftware
      @midniteoilsoftware 2 роки тому +1

      @@libberator5891 Good ideas. I have a 3D space shooter that's currently only playable on desktop or WebGL. I've been thinking of how to port it to mobile but am hung up on the controls. The desktop version has yaw/pitch/thrust controls. I can't see how to do that easily on mobile, even with multiple thumbsticks because you'd need a 3rd thumb for the fire button - lol. Having it automatically roll would solve that problem.

  • @panmacius2171
    @panmacius2171 2 роки тому

    Now, I can make opressor mk2 in my unity game

  • @boogetow3484
    @boogetow3484 2 роки тому

    How do you do your graphics and effects? In all your videos your games look so nice i would love to learn how

    • @Tarodev
      @Tarodev  2 роки тому

      This one is just a terrain which I molded and painted and some nice lighting 😊
      I do plan on doing a visuals video

    • @boogetow3484
      @boogetow3484 2 роки тому

      @@Tarodev I see, my comment is more overall in all your videos, the object pooling video had crazy nice looking T symbols, the DOtween video also had very beautiful looking shapes in it. Is it shader magic or something else? I would love to learn how to make my games look this good

  • @ivanchez
    @ivanchez Рік тому

    Nintendo hire this man!

  • @panickal
    @panickal Рік тому

    No velocity change sadly. Adding velocity instead of setting it with this code makes the missile behave strangely in some ways. Been trying to fix it for some time.

  • @darkdoom907
    @darkdoom907 2 роки тому

    a homing missile, but elaborated video, I am a learner and its quite difficult for me to grasp the script, i mean what is var?

    • @darkdoom907
      @darkdoom907 2 роки тому

      Okay i got past those, but what was the _deviatedprediction and now i dont get the predictMovement method;(

  • @huseyinakkoc1062
    @huseyinakkoc1062 8 місяців тому

    how can I implement it in 2d ? can you pls help

  • @dev.ashesh
    @dev.ashesh Рік тому

    This works on online multiplayer?

  • @nikunev
    @nikunev 2 роки тому

    Holy ****, 1:32 seconds tutorial and all important and even advanced stuff about a homing missile presented. But BE WARNED this is not for beginners, because the Quaternion and corresponding Unity functions are not explained here. Still, Brackeys homing missile tutorial was just smoked right here right now..

  • @l.manoelsousa3468
    @l.manoelsousa3468 Рік тому

    Whta the neme of the music?

  • @eladonstar2721
    @eladonstar2721 2 роки тому +1

    Unity textmesh pro... Lol... Nice intro

  • @rangerthememe1305
    @rangerthememe1305 Рік тому

    Thought this was going to be a aim 9 coding tut now doubly confused

  • @irgiefarras2159
    @irgiefarras2159 Рік тому

    "in a realistic way" if you watch how it works in a movies like top gun or some random pakistani dogfighting film then it's trus, but i think that's okay for a game

  • @BlackoutGamingChannel
    @BlackoutGamingChannel 2 роки тому +1

    I would have unsubscribed if that rocket didn't impact & explode 😂😂😂

    • @Tarodev
      @Tarodev  2 роки тому

      Haha! I wouldn't do that to you man

  • @Vlad-xz9ro
    @Vlad-xz9ro 2 роки тому +1

    I am from Ukraine and this video has just been shown in my recommendations.😅😅😆