Рет қаралды 59,304
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: • Impact Effects with Sc... 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: github.com/llamacademy/script...
💸 Ongoing sales 💸
⚫ See all active asset sales on the Asset Store: assetstore.unity.com/?on_sale...
⚫ Save 25% off your first Asset Store Order: prf.hn/click/camref:1101l9QvC...
⚫ Save up to 50% on NEW Assets: assetstore.unity.com/?new_sal...
📚 References
⚫ Unity 2021 Object Pool: • Unity 2021 Object Pool...
⚫ Impact System: • Impact Effects with Sc...
⚫ Scriptable Objects, Explained: • ScriptableObjects, Exp...
⚫ Lerping Fundamentals: • Lerping Fundamentals -...
❤ Believe in LlamAcademy's mission and have received value from the videos? Become a Patreon Supporter or KZfaq Member:
⚫ Patreon: / llamacademy
⚫ KZfaq Member: / @llamacademy or click the Join button on any video
📱 Let's stay connected
KZfaq: / llamacademy
Patreon: / llamacademy
Facebook: / llamacademyofficial
Twitter: / thellamacademy
TikTok: / llamacademy
Instagram: / llamacademy
----
Most tutorials come from knowledge gained making survival.llama.software Llama Survival - a top-down zombie survival shooter for Android and iOS.
I also have some Unity Assets: assetstore.unity.com/publishe...
Some links may be affiliate links, which at no additional cost to you, gives me a small portion of the purchase.
#unitytutorial #tutorialtuesday #gamedev #tutorial #unity #llamacademy #gamedevelopment
Chapters:
00:00 Intro & Overview
01:43 Why ScriptableObjects over Prefabs?
02:35 GunType.cs
02:48 ShootConfigScriptableObject.cs
03:28 TrailConfigScriptableObject.cs
04:26 GunScriptableObject.cs - Variables
05:45 GunScriptableObject.cs - Spawn()
06:33 GunScriptableObject.cs - CreateTrail()
07:15 GunScriptableObject.cs - Shoot()
09:14 GunScriptableObject.cs - PlayTrail()
10:47 Design Discussion
11:27 GunScriptableObject.cs - Adding Impact Effects with SurfaceManager
12:22 Become a Supporter
12:53 PlayerGunSelector.cs
14:28 PlayerAction.cs
15:08 Creating & Configuring the Gun ScriptableObjects
19:48 Demo
21:00 Closing Thoughts on this Implementationver