Uploaded February 2024 | Updated September 2026, 2 hours ago
Learn how to extend our ScriptableObject gun system to support shrapnel shooting shotguns (or any other type of multi-bullet-per-shot gun)!
We'll also go into how to add knockback to arbitrary objects using our ICollisionHandler and some new interfaces!
🔶 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/scriptable-object-based-guns
🏷️Save 25% on the ultimate C# IDE: JetBrains Rider with code LLAMACADEMY: jetbrains.com/store/?section=personal&billing=yearly
📚 Resources:
🟠 Full Gun Series Playlist in case you're new here: youtube.com/playlist?list=PLllNmP7eq6TQJjgKJ6FKcNFfRREe_L6to
🟠 Editor Scripting Tutorials: youtube.com/watch?v=3w9iXT6wx5g & youtu.be/moXvNj7QUHE
🟠 AI Series 51 for more in-depth explanations regarding Knockback & AI:
🟠 Physic Materials, Explained: youtube.com/watch?v=Z3TE8cejwzk
🟠 Collision Impulse: docs.unity3d.com/ScriptReference/Collision-impulse.html
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 High Level Overview
02:08 Configure a Shotgun
04:12 Support Minimum Spread & Add Multiple Bullets per Shot - ShootConfigScriptableObject.cs
05:18 Update Editor Script - ShootConfigScriptableObjectPropertyDrawer.cs
06:23 Configure New Values
06:47 Shoot Multiple "Bullets" Per Shot - GunScriptableObject.cs
07:28 Finalize Configuration to Test it
09:15 Demo Shotgun
09:57 Knockback - Create Physic Materials
11:13 Enemy AI - Key Components
11:54 Knockback Configuration - KnockbackConfigScriptableObject.cs
13:10 Add Knockback Config to GunScriptableObject.cs
13:45 Knockback.cs & Extend ICollisionHandler Capability
15:25 How to Knockback Enemies with IKnockbackable.cs & GunScriptableObject.cs
17:26 Example of Knockback in EnemyMovement.cs
21:46 Example of Simple Knockback - SimpleKnockbackable.cs
21:55 Chain Knockbacks - KnockbackOnCollision.cs
23:07 Final Setup & Configuration
25:13 Final Demo, Closing Thoughts, & Support LlamAcademy
Learn how to extend our ScriptableObject gun system to support shrapnel shooting shotguns (or any other type of multi-bullet-per-shot gun)!
We'll also go into how to add knockback to arbitrary objects using our ICollisionHandler and some new interfaces!
🔶 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/scriptable-object-based-guns
🏷️Save 25% on the ultimate C# IDE: JetBrains Rider with code LLAMACADEMY: jetbrains.com/store/?section=personal&billing=yearly
📚 Resources:
🟠 Full Gun Series Playlist in case you're new here: youtube.com/playlist?list=PLllNmP7eq6TQJjgKJ6FKcNFfRREe_L6to
🟠 Editor Scripting Tutorials: youtube.com/watch?v=3w9iXT6wx5g & youtu.be/moXvNj7QUHE
🟠 AI Series 51 for more in-depth explanations regarding Knockback & AI:
🟠 Physic Materials, Explained: youtube.com/watch?v=Z3TE8cejwzk
🟠 Collision Impulse: docs.unity3d.com/ScriptReference/Collision-impulse.html
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 High Level Overview
02:08 Configure a Shotgun
04:12 Support Minimum Spread & Add Multiple Bullets per Shot - ShootConfigScriptableObject.cs
05:18 Update Editor Script - ShootConfigScriptableObjectPropertyDrawer.cs
06:23 Configure New Values
06:47 Shoot Multiple "Bullets" Per Shot - GunScriptableObject.cs
07:28 Finalize Configuration to Test it
09:15 Demo Shotgun
09:57 Knockback - Create Physic Materials
11:13 Enemy AI - Key Components
11:54 Knockback Configuration - KnockbackConfigScriptableObject.cs
13:10 Add Knockback Config to GunScriptableObject.cs
13:45 Knockback.cs & Extend ICollisionHandler Capability
15:25 How to Knockback Enemies with IKnockbackable.cs & GunScriptableObject.cs
17:26 Example of Knockback in EnemyMovement.cs
21:46 Example of Simple Knockback - SimpleKnockbackable.cs
21:55 Chain Knockbacks - KnockbackOnCollision.cs
23:07 Final Setup & Configuration
25:13 Final Demo, Closing Thoughts, & Support LlamAcademy










