In this Unity tutorial, learn how to make your AI throw accurate projectiles at stationary targets given only a maximum allowable throw velocity. You can also learn how to make the AI be pretty dang good at predicting where the player will be and hitting them while they are moving, still with only a maximum allowable throw velocity. No hard coded heights, just accurate throws!
I spend a lot of the video covering how the math works out so you can understand the process we follow to get to this result, as well as covering the equations we're using so you can take this implementation and enhance it to further suit your game's needs. Of course, if this is "good enough" for you, feel free to take it off the shelf. If you're looking for even more accurate predictions or throwing over/under obstacles, don't worry! I also cover what else you need to do to take those use cases into consideration!
Have you been getting value out of these tutorials? Do you believe in LlamAcademy's mission of helping everyone make their game dev dream become a reality? Consider becoming a Patreon supporter and get your name added to this list, as well as other cool perks. Head over to https://patreon.com/llamacademy to show your support.
- Andrew Bowen
- YOUR NAME HERE!
- YOUR NAME HERE!
- Gerald Anderson
- AudemKay
- Matt Parkin
- Ivan
- Paul Berry
- Reulan
- YOUR NAME HERE!
- Bastian
- Trey Briggs
- Matt Sponholz
- Dr Bash
- YOUR NAME HERE!
Interested in other AI Topics in Unity, or other tutorials on Unity in general?
- Requires Unity 2020.3 LTS or higher.
- NavMesh Components. How to install this is discussed here.