Uploaded July 2022 | Updated September 2026, 1 hour ago
Need to show the path of a projectile? Not paying attention in Physics catching up to you? No problem! Learn how to draw the trajectory of a projectile would take using a LineRenderer and one of those pesky physics formulas you said you'd never use again! Show a visualization of where those objects will go!
We're using a grenade in this case, but it can be applied to cannon balls, bullets affected by gravity, throwing a banana, or any other projectile!
If you're checking out the GitHub Repository below, make sure to get the Unity Particle Pack and head over to Mixamo and pick up the "Throw Object" animation (tip: trim it down to skip the pick-up section) and add it to the Animator with an upper body avatar mask.
πΆ ALL THINGS LlamAcademy now available at: https://llamacademy.dev/support including latest tutorials, courses, ways to support, and more! Check it out π
π¨βπ» Get the FULL FREE PROJECT on GitHub: github.com/llamacademy/projectile-trajectory
π·οΈSave 25% on the ultimate C# IDE: JetBrains Rider with code LLAMACADEMY: jetbrains.com/store/?section=personal&billing=yearly
Some links may be affiliate links, which at no additional cost to you, gives me a small portion of the purchase.
Chapters:
00:00 Topic Introduction
00:45 Scene Overview
01:51 Show Visualization in GrenadeThrower.cs (with math explanations)
06:07 Hooking up references in the editor
06:47 Demo 1 - See the need for Raycasting
07:51 Prevent Line From Going Through Walls in GrenadeThrower.cs
10:10 Demo 2 & Closing
Need to show the path of a projectile? Not paying attention in Physics catching up to you? No problem! Learn how to draw the trajectory of a projectile would take using a LineRenderer and one of those pesky physics formulas you said you'd never use again! Show a visualization of where those objects will go!
We're using a grenade in this case, but it can be applied to cannon balls, bullets affected by gravity, throwing a banana, or any other projectile!
If you're checking out the GitHub Repository below, make sure to get the Unity Particle Pack and head over to Mixamo and pick up the "Throw Object" animation (tip: trim it down to skip the pick-up section) and add it to the Animator with an upper body avatar mask.
πΆ ALL THINGS LlamAcademy now available at: https://llamacademy.dev/support including latest tutorials, courses, ways to support, and more! Check it out π
π¨βπ» Get the FULL FREE PROJECT on GitHub: github.com/llamacademy/projectile-trajectory
π·οΈSave 25% on the ultimate C# IDE: JetBrains Rider with code LLAMACADEMY: jetbrains.com/store/?section=personal&billing=yearly
Some links may be affiliate links, which at no additional cost to you, gives me a small portion of the purchase.
Chapters:
00:00 Topic Introduction
00:45 Scene Overview
01:51 Show Visualization in GrenadeThrower.cs (with math explanations)
06:07 Hooking up references in the editor
06:47 Demo 1 - See the need for Raycasting
07:51 Prevent Line From Going Through Walls in GrenadeThrower.cs
10:10 Demo 2 & Closing










