Shooting, Simple Spread, and Bullet Trails in a ScriptableObject-Based Gun System
Published: 11 Oct 2022
Learn how to create a ScriptableObject-based gun system from scratch for your game!
In this video, which is part 1 of a much larger gun system series, we'll create 3 ScriptableObjects to control our Gun, Bullet Trails, and Shoot Configurations for 2 types of guns. Specifically, we're doing "Hitscan" or Raycast shooting in this video.
In this video I DO NOT cover the Impact System: https://youtu.be/kT2ZxjMuT_4 you can check out that video for the full explanation for how that works
That’s for the SurfaceManager and ImpactType both. If you’re not interested in using that system for impacts, feel free to just remove that code! Everything will still work!
PlayerIK is a very simple demo script implemented solely for the demo. As I mention in the video, this will be covered in the future, so you can skip that part for now, or check out the project on GitHub to see that naïve implementation.
In this series you'll learn how to make a configuration-driven gun system with ScriptableObjects that will be able to have:
⚫ Hitscan Guns - Covered in THIS VIDEO!
⚫ Projectile Guns
⚫ Simple Bullet Spread - Covered in THIS VIDEO!
⚫ Complex Bullet Spread
⚫ Reloading
⚫ Attachments
⚫ Animated Models
⚫ Simple Impact Damage
⚫ Damage Effects such as burning, freezing, explosions, etc...
⚫ And even more!
👨💻 As always, all code from this video is available on GitHub: https://github.com/llamacademy/scriptable-object-based-guns
🏷️Save 25% on the ultimate C# IDE: JetBrains Rider with code LLAMACADEMY: https://www.jetbrains.com/store/?section=personal&billing=yearly
📚 References
⚫ Unity 2021 Object Pool: https://youtu.be/zyzqA_CPz2E
⚫ Impact System: https://youtu.be/kT2ZxjMuT_4
⚫ Scriptable Objects, Explained: https://youtu.be/dIAAi54Ty58
⚫ Lerping Fundamentals: https://youtu.be/IymDGkzwJts
🧡 Believe in LlamAcademy's mission and have received value from the videos? Here's how you can show your support:
🌟 Patreon: https://www.patreon.com/llamacademy
🌟 YouTube Member: https://www.youtube.com/channel/UCnWm6pMD38R1E2vCAByGb6w/join or click the Join button on any video
📚 Take my Unity ShaderGraph Course:
https://www.gamedev.tv/p/unity-shader-graph?affcode=45216_kuvg0bp7
👕 Get yourself some LlamAcademy merch: https://llamacademy.myspreadshop.com/
💸 Use my Affiliate Link for Humble Bundles https://humblebundleinc.sjv.io/9g4ak4
💸 Publisher Sale! 50% OFF an entire publisher's Assets! Publisher changes weekly! https://assetstore.unity.com/publisher-sale?aid=1101l9QvC (affiliate)
💸 Save up to 50% on NEW Assets: https://assetstore.unity.com/?new_sale=true&orderBy=1&aid=1101l9QvC (affiliate)
Some links may be affiliate links, which at no additional cost to you, gives me a small portion of the purchase.