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
This video shows a great combination of design and technique, in such a stylish way.
Straight to the point! Love your short videos.
Simple and to the point, cracking stuff Tarodev!
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!
you are amazing Taro. I really like your videos and tutorials, it really helps me a lot. Keep it up!
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
Damn... thanks man
@@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.
Woah woah woah, that is heresy ;)
@@RalphH007 brackeys, our lord and saviour
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
Loved these small videos. We need more of these.
The Unity community should be glad and proud that has such geniuses like you.
Keep it up bro!
Thank you once again for your contribution to Unity community. It really helps a lot to learn for beginners like me.
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)
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.
Best content out there, quick and straight to the point.
Great content and visuals for a one and a half minute video 👍 Love
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!
Awesome video man! Thanks for your excellent content.
U really saved my day
the perfect tutorial
The perfect viewer ♥
Been a Unity dev for 6 years and your content has to be some of the absolute best on UA-cam.
Ultra high level video! Thanks dude.
Nifty, I look forward to making use of this.
Another great tutorial, can easily be remade in 2D as well with the logic💙
Really cool, especially the reaction time based on distance. Going to implement this in 2D later :)
Your work is amazingly professional for how little views you get! I think eventually you will get the recognition you deserve!
Great! Very simple and practical!
wow that is so cool! Thanks a bunch!!
Like always a little but powerfull tutorial :) Thanks a lot!
This is perfect tutorial. Thanks!
nice! I could imagine using this to create a shoot and run game :))) Thank you!
This is awesome!
Gorgeous!
So cool, nice tutorial 😁
this is prolly the best made tutorial i’ve ever seen
Whoa
no homo
@@bradb5129 nothing's off the table bro
Brackeys 2.0 Plus - love your work bossman. Thanks for the inspirations🍺
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
Yeah man, tell me about it. YT ripped it to shreds :( Partly my fault for the vignette. Live and learn!
Yet again, me thinking I got perfect missiles only to see this awesome cosine feature :)
You rock!
You could also add sin on the Y axis for a full circle rotation. That'd look cool :)
perfect for my project. ty
best unity channel rn
Tarodev I really love u ❤️ great tutorial!
We*
Excellent, thanks ☺
Totally awesome
wow tarodev new vid!
The most underrated channel on youtube
@Tarodev - You're a rocket, these tutorials are engine fuel, and your channel is headed to the Moon!
Yay 😂
I can’t wait until we see game mechanics in them satisfying trend videos.
Excellent content! Love the production value added by the terrain and audio... where did you get these trees?? 🤣🤣
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 😜
Awesome video. I would love to know more about the camera script.
Awesome content! Thanks! Do you have a tutorial for the wind particles/trails that appear occasionally ? It looks really good.
Oh nvm, I think it's from the Epic Toon Fx asset. Thanks!
What a convenient and digestible video.
Hope it helped ❤️
Danke!!
Please can you make a video on how you make your game graphic look soo good, btw love your videos
you's awesome :0
Wow man
Noice!
Thank you for this! Can you make a tutorial on creating turrets that can fire at a target in motion with variable speed projectiles?
Sounds fun!
That intro 😍
I knew you'd love it blobby
Could you give a little more explanation regarding prediction?! Gr8 video though!
💣
really cool video!!! how would you implement that the missile dodges terrain?
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.
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
Ohhhhh!! Good point. Damn... I'll try remember that for next time
Nice video!
How do you record the output from unity?
Do you just use a screen recorder like OBS?
Unity video recorder. Official plugin :)
Hi, can you make a video about script performance optimization pls, thanks
S500 missile game the best
Your videos are usually extremely clear. While this was fairly simple I found this format more difficult to follow.
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
How can we allow the homing missles to work after being instantiated?
hello, can you teach how to configure a helicopter and have a sight to launch rockets on it?
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
Do you mean circular noise instead of jus horizontal? Adding Mathf.Sin to the Y deviation should do the trick.
@@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.
@@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
@@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.
Now, I can make opressor mk2 in my unity game
How do you do your graphics and effects? In all your videos your games look so nice i would love to learn how
This one is just a terrain which I molded and painted and some nice lighting 😊
I do plan on doing a visuals video
@@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
Nintendo hire this man!
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.
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?
Okay i got past those, but what was the _deviatedprediction and now i dont get the predictMovement method;(
how can I implement it in 2d ? can you pls help
This works on online multiplayer?
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..
Whta the neme of the music?
Unity textmesh pro... Lol... Nice intro
Thought this was going to be a aim 9 coding tut now doubly confused
"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
I would have unsubscribed if that rocket didn't impact & explode 😂😂😂
Haha! I wouldn't do that to you man
I am from Ukraine and this video has just been shown in my recommendations.😅😅😆
Oh gosh lol!