Some of this I have implemented myself, but never before with Scriptable Objects, which sounds like will allow for much more customizability and expandability. Excited for this series!
@jaulloa218 ай бұрын
I like how this complex system is organized for a noob that would be frustrated otherwise
@brickch4pel Жыл бұрын
One of the best things about your tutorials is finding out about new/old things that I never even knew about in all my time of using unity. (case in point, native unity Object Pools?!?!?!?! This is so cool!!!)
@AmgedAlfakih2 жыл бұрын
This an amazing weapon system, it'll be an amazing starting point to add more advanced stuff like gravity or bouncing
@LlamAcademy2 жыл бұрын
Thanks 🙏! Gravity will come with projectile-based weapons in the future. I covered bouncing bullets before here: kzbin.info/www/bejne/fZy2pYpuYrZohpI I wasn’t planning to cover it in here, but that’s an interesting idea to consider to have it all in one place.
@AmgedAlfakih2 жыл бұрын
@@LlamAcademy my goal is to add gravity to the raycast, I mean a noob I'll learn a lot if i do it
@LlamAcademy2 жыл бұрын
You can do that, but usually bullets have relatively low mass and high velocity which makes the normal hitscan ray cast “good enough” of a simulation. If you really want to add it, you can follow the concept of this video: kzbin.info/www/bejne/bp6qi3WPqLiLmbM and it will give you the result you’re looking for.
@potatoguy9653 Жыл бұрын
Bro, i'm tryna make an fps game, and I haven't been able to find a good video for this kind of stuff for weeks. You, my dear friend, are a god send
@geri43672 жыл бұрын
Hell yeah. This is amazing :D Once the series is over, something similar for an ability system (think League of Legends for example) would be sick. I've been doing some research lately and there isn't much valuable content about it. Maybe it's a good challenge and opportunity Anyways, thanks for your awesome work!
@LlamAcademy2 жыл бұрын
❤️! That’s a great idea! I have a real life use case for that, so maybe once I get some time to play with it and see the challenges I can put together a series on it!
@Inf4mousKidGames Жыл бұрын
For those of you wanting to use this for an FPS, configure the player camera to be the raycast start point, from what I've heard making the camera the start point fixes a lot of inconsistencies with aiming
@jesse_belkman10 ай бұрын
Could you, please, explain how to do it?
@pritiguptaraina30838 ай бұрын
@@jesse_belkman too late probs but just switch the camera to that thing
@sansavatar59295 ай бұрын
You only got 22k subscriber, yes I said ONLY because for tutorials of such quality it's not that much! Keep going!
@LlamAcademy5 ай бұрын
🧡thank you! I appreciate that!
@Blinkers2007GameDev Жыл бұрын
Thanks man! The create tail and render trail funcion and the variabels was very useful for creating the perfect trail. It's always better controlling it with the code. Learnt alot and I could now use this in my own game to create good looking bullets. Thanks!!!!!!
@peche87_gameDev2 жыл бұрын
Great content as usual! Looking forward the next videos on this serie! :)
@LlamAcademy2 жыл бұрын
Thanks 🙏 I am too 🙂
@K.Z007 Жыл бұрын
Great, what a brilliant brain you have to create such sophisticated system and you been so kind to share with us. Thank you a lot mate. You are amazing.
@LlamAcademy Жыл бұрын
Wow thank you for that! It made me smile 😊
@paulberry33592 жыл бұрын
So looking forward to this series !!!
@LlamAcademy2 жыл бұрын
Me too 😁! This is one topic area I feel is underserved and needed!
@bobertbwild13504 ай бұрын
so helpful man, thanks for showing the older system too
@pritiguptaraina30838 ай бұрын
ive not even finished this series yet and i know its gon be good (everything i need for fps)
@ضله-ث8ط2 жыл бұрын
you are awesome ,please keep the brilliant work❤❤
@durvids4742 жыл бұрын
Great stuff as always!
@LlamAcademy2 жыл бұрын
Much appreciated 🙏
@GAMERZ_exam786Ай бұрын
Broooo you made my hand and fingers pain by writing that much code for the first time 😅
@lv15433 күн бұрын
i have absolutely no idea whats going on but i will push forward.
@BrunoBozicB Жыл бұрын
The "ParticleSystem" named "ShootSystem", what is it? is it a particle system nested somewhere on the gun prefab? is it for the muzzle flash? Could you please point me to the video that explains the muzzle flashes and/or the "ShootSystem"? Thanks in advance for the information.
@BrunoBozicB Жыл бұрын
Found a brief mention of this here: kzbin.info/www/bejne/mXqWdmqVm5xng6M if anyone is interested...
@LlamAcademy Жыл бұрын
Hey! The ParticleSystem named ShootSystem is gathered at the time of spawning the gun into the world. I set it up in the code around time 6:20. Around 16:25 I talk about the prefab configuration of the glock and m4. I didn't talk too much about the positioning of it, but you should place it where you want the bullets to spawn, so close to the tip of the muzzle. The assumption here is the muzzle flash and the bullet spawn point can be the same place In your other comment, in that video we drag references in the Inspector, which I tried to avoid here, instead I'm opting to pick it up automatically on Spawn.
@jeremywieland714 Жыл бұрын
@@LlamAcademy I downloaded your github repo and opened it in the same unity version. Looks like the MuzzleFlash01 is having issues (missing Prefab with guid: numbers-blah-blah. Sadly it keeps me from trying out your system :( ... Thanks for the tuts though, very nice!
@LlamAcademy Жыл бұрын
@@jeremywieland714 Did you import the Unity Particle Pack after checking out the GitHub?
@jeremywieland714 Жыл бұрын
@@LlamAcademy That was it thanks!
@legendsmb-pw6mv Жыл бұрын
In GunScriptableObject.cs, why is the TriangleIndex set to 0 directly in the following line? SurfaceManager.Instance.HandleImpact( HitCollider.gameObject, HitLocation, HitNormal, ImpactType, 0 ); Won't this result in incorrect impact results if there are multiple submeshes?
@DJRussellBrian Жыл бұрын
Thanks for this dude!
@adventuretuna2 жыл бұрын
Wouldn't the GunType enum prevent you from updating the game over-the-air (like you mentioned in 1:50)? Adding a new gun type would require you to update the code and thus require a new build. Since you're using it as a unique identifier, a string or integer might be a better fit. Just need to remind the designer to make the identifiers unique (or write an editor script to automatically fix them). Otherwise pretty great tutorial. Straight to the point and very little to no fluff.
@LlamAcademy2 жыл бұрын
Yes you are correct! In the final section I discuss ways to solve that problem. Specifically, I talk about how you could use the "Name" parameter on the GunScriptableObject to match against in place of GunType. Edit for some more context: For most developers, that's not going to be within the scope of what they'll implement. Typically I don't like "magic strings" that have significant meaning, so I implemented the GunType to have a declarative way to match the guns for the majority of users, and in the end of the video I talk about how you can support the over the air updates by using the Name as a "magic string"
@adventuretuna2 жыл бұрын
@@LlamAcademy Alright I missed that part. The real solution to avoid magic strings would be to have an editor tool that automatically populates the identifiers with Guid or something similar but that's way out of this video's scope. Might be an interesting topic in the future though. I feel like editor scripting in general is not discussed a lot.
@billybillington5340 Жыл бұрын
Hi, I am trying to follow this great tutorial, but at 11:34 you use (SurfaceManager) and it is showing up as an error for me. I do not know where in the video this class was created, hope you can get back to me on this. :)
@LlamAcademy Жыл бұрын
Please see pinned comment
@GTZ-982 ай бұрын
Hey Chris, how do you plan these Systems? This Guide is honestly pretty damn good. Do you just start by coding some of the ideas until you have a working prototype or do you plan these systems upfront and if so got any tips on how to design systems?
@LlamAcademy2 ай бұрын
My planning for systems is probably not the ideal model. I typically think about things for...between seconds to minutes then get started working on it from basically just the "idea". Usually it works out okay, but there are some holes or problems that I refactor as I run into the limitations of whatever the initial design was. For this system I had already done that full process of design, implementing, & refactoring in my old (now unpublished) mobile game Llama Survival. I had already identified a bunch of the problems & solutions that I couldn't or wouldn't solve in the first implementation for that game, and that was the starting point for this tutorial series. I think what works best for you really depends on whether you like to plan all the details out ahead of time, or you like to just get into the weeds and figure it out. The latter has a higher risk of rework and the first iteration usually has some problems. I just like to just get started on things 😅. That's more rewarding for me than spending a ton of time on the initial design.
@GTZ-982 ай бұрын
@@LlamAcademy Thanks for the insights. Yeah what I've found to be working quite good is a mix of both. Just thinking about what I need on a high level and then get right to work. When I feel like I'm stuck I iterate on my design and try to fix things on paper before I code again. When I just code before having a high level overview that's usually when shit starts to blow up for me 😅
@kamron48252 жыл бұрын
In the GunSo you have ImpactType and SurfaceManager, which appear to not be a part of the unity engine. where did you make those or get those classes/objects from? Same with PlayerIK in PlayerGunSelector
@LlamAcademy2 жыл бұрын
👋 Hi! PlayerGunSelector we implemented in this video. When I talk about SurfaceManager / ImpactType I mentioned it was covered in another video (that’s linked in the description). The full project is on GitHub so you can view all those files. A better version of the PlayerIK will be done in a future video. As I said, It was really just for the demo to look nicer with the hands actually on the gun
@joaodias8824 Жыл бұрын
I don't think that you're going to see this, but if you did, how did you fix this?
@kamron4825 Жыл бұрын
@@joaodias8824 sadly I never fixed it
@joaodias8824 Жыл бұрын
@@kamron4825 if I figure it out I'll let you know
@LlamAcademy Жыл бұрын
Hello. As I said above you can find the SurfaceManager and ImpactType on the GitHub github.com/llamacademy/scriptable-object-based-guns/tree/main/Assets/Scripts/Surface%20Manager If you would like to understand how those are created, you can check out the associated tutorial: kzbin.info/www/bejne/oYWVi6uggtqHlZY These can be completely skipped and ignored if you do not want to use that impact system without any additional loss in functionality. PlayerIK is also in the repository: github.com/llamacademy/scriptable-object-based-guns/blob/main/Assets/Scripts/PlayerIK.cs, but again I don’t recommend relying on this because I just quickly put it together without much thought. Later in the series we’ll probably review a better implementation. In this video I covered PlayerGunSelector at 13:00. You can always check the chapters at the bottom of the video to see each section.
@LlamAcademy Жыл бұрын
In this video I DO NOT cover the Impact System: kzbin.info/www/bejne/oYWVi6uggtqHlZY 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. Edit: Aiming IK is covered in depth here: kzbin.info/www/bejne/mZnKfYWgiMaijsU
@Maskeowl Жыл бұрын
where i can get that too? should i download it ? isthere tutorial for it ?
@LlamAcademy Жыл бұрын
Yes there is a tutorial, that’s linked above. It also has the GitHub repository in the description of the video. This video also has a GitHub repository that includes that code.
@Maskeowl Жыл бұрын
@@LlamAcademy OHHH i read ffew times but i cant see git hub thanks man very cool
@bobertbwild13504 ай бұрын
tysm, i was so worried
@J0ELPC Жыл бұрын
Hey LlamAcademy, i love your video. however i have one small issue when adding public ImpactType ImpacType; i get the error CS0246: The type or namespace name 'ImpactType' could not be found (are you missing a using directive or an assembly reference?). is surface manger a addon i need to add to my unity project???
@LlamAcademy Жыл бұрын
Check out pinned comment & description!
@dark_joeha2k3r5520 күн бұрын
I have a question. Maybe someone can help me. But first a big thank you for the great tutorial! The raycast is performed at the beginning of the shot. How is it supposed to catch an moving object like an enemy which is at that point not in line with the raycast?
@LlamAcademy17 күн бұрын
When using a Raycast you perform all the hit detection on the frame you click, everything after that is just VFX that happens after the fact to show the player something is happening :) If you shot them where they were that frame, it should all be good. If not, then you missed!
@0lt0698 күн бұрын
Hello! I have a little issue with trails, i tried to apply your system in my fps project, and it mostly works, but i can't see the bullet trails in game mode. Through editor i can see that they're actually going out of my gun(not the actual trails, but the objects, when i select them in editor) in right direction(i think it happens because i use 2 cameras, 1 of it actually renders weapon and all its children in overlay. But i have a problem with muzzleflash's child in weapon prefab, its not applying to layer for player weapon, that might be the issue, but i am still not sure). Sorry if my comment seems incorrect, English is not my native language.
@0lt0697 күн бұрын
I'm still looking for a solution, but as far as I can tell, the problem is not related to layers and cameras, because no matter what layer is selected, objects in it are always rendered except bullet trails
@donaldsimmons4370 Жыл бұрын
Great series. Learning a lot about scriptable objects. I do have one question however. In the repository there are a number of "Editor" scripts that aren't explained in the video and it appears the SO scripts won't function without them? thx
@LlamAcademy Жыл бұрын
You do not NEED any of the editor scripts for them to work, but they make it easier, faster, and more convenient to set stuff up. How the custom inspectors are done are covered in these: kzbin.info/www/bejne/aaicmouKa9yra8k & kzbin.info/www/bejne/o6C7p4GgbLaIfqc Each video in this series has its own branch in the github repository so if you want to see just what was done in video 1, check out branch "part-1"
@ChadGatling Жыл бұрын
You need to stop doing everything uprfront. It is soo hard to figure out what is actually happening when you just spend 10 mins rattling off a bunch of code. Make it by following the logic of the functionality instead of setup then implementation. Start with a basic implementation and then add complexity on top of that. You might as well just have people download the files because this isn't really teaching the concepts from the ground up it is just rote memorization of how to do a very specific type of thing.
@masterhumanprimitive4040 Жыл бұрын
I agree with you about this 😢
@albertum_o2 Жыл бұрын
I couldn't finish my code relying this turorial, but thanks, it's really cool video. I faced mistake when I tried make ObjectPool(CreateTrail) - now we need to provide a second argument "actionOnRelease". I can approximately imagine how to do it, but anyway it's a bit complicated to me).
@LlamAcademy Жыл бұрын
Hmm... the 2021 Object Pooling system should not require you provide the secondary argument. If you want to understand more about the 2021 Object Pooling system you can check out my full tutorial on that: kzbin.info/www/bejne/sKrdonSVeLWtaKc For any shooting system, I highly recommend using an Object Pool to eliminate garbage and keep your game running smoothly
@albertum_o2 Жыл бұрын
@@LlamAcademy Thank you for your answer! I know that I need to dig deeper. I'll definitely check it out to fully understand this topic.
@Sam4Progress10 ай бұрын
21:00 so my question here is, I've tried putting assets in the Resources Folder before, and then created a folder hierarchy within it, and couldn't reach the hierarchy. What do I need to do to reach the hierarchy or is that what addressable resolves? This is effectively my second week in Unity and I am trying to learn C# principles as well as how Unity functions, so forgive me if this question is obvious, or incomplete.
@LlamAcademy9 ай бұрын
For resources folder you can load with the path name to the file without “Resources”. Resources are bundled on build, so if you include everything there, you can easily reference them. Addressables allow you to extend the game without needing to rebuild the whole game.
@Sam4Progress9 ай бұрын
@@LlamAcademy awesome, I saw some videos, that were not beginner level, and it seemed like that was the next step in my programming journey after the basics! Thanks for confirming that!
@mat3iav52 Жыл бұрын
hey amazing video and i have followed but i have a problem, when i click "create
@LlamAcademy Жыл бұрын
Usually that’s because the gun scriptable object was not converted from “: MonoBehaviour” to “: ScriptableObject” or the [CreateAssetMenu] tag is missing, or improperly defined (such as copy/paste issue with multiple SO with the same path)
@mat3iav52 Жыл бұрын
@@LlamAcademy i did everything correct as you said but still doesnt work i grabbed the code from your github so its copy pasted, i dont know what to do now, if you are ok on communicating on discord so i can show you a picture of the error. it would be the easiest method.
@LlamAcademy Жыл бұрын
Okay. Send me a message llamasoftware#5070
@kivivikix9 ай бұрын
@@LlamAcademy Hi, what was the issue on this one?
@kivivikix9 ай бұрын
oh, found it.
@oakleysands-my1kt11 ай бұрын
why wont my private ObjectPool TrailPool; work this is the error Assets\Scriptys\GunScriptableObject.cs(21,13): error CS0246: The type or namespace name 'ObjectPool' could not be found (are you missing a using directive or an assembly reference?)
@oakleysands-my1kt11 ай бұрын
pls help🤔
@LlamAcademy10 ай бұрын
Which version of Unity are you on? The object pooling API was introduce in the 2021 LTS.
@InfernoCreator Жыл бұрын
Amazing! | Just asking if you have any tutorial to zoom in with the gun? If you do please reply to me.
@LlamAcademy Жыл бұрын
I do not but that is on my list for this series
@ananthukrishna525929 күн бұрын
Having 'LastShootTime' in the SO itself, won't that cause problems when there are multiple instances of 'PlayerGunSelector'? For eg:- Let's say we use this system to equip enemies with weapons and there are multiple enemies with M4, but there is only on 'GunScriptableObject' of M4. Won't changing the 'LastShootTime' for one enemy change it for all enemies? or even in a multiplayer scenario, won't it cause a problem?
@LlamAcademy29 күн бұрын
Good question. In this video we didn't get into solving that problem, but you are right you will need to clone the SO or create instances to be used at runtime. Later on in the series we tackle that.
@ananthukrishna525929 күн бұрын
@@LlamAcademy oh that's nice. I didn't check the whole series as I just wanted to check the design pattern (even tho I have watched this video several times, i keep coming back. lol). Seems like I should put in proper time to watch the whole series.
@SGUDevs2 ай бұрын
beam trails will work with this type of system or will it need additional programming?
@LlamAcademy2 ай бұрын
Depends on how you want to do the beam I suppose
@JeebZ-3D8 ай бұрын
Awesome tutorial! Quick question, I've used the system for a RTS game, but I can't seem to figure out why does the duplicated unit detects an enemy, the original shoots. Any thoughts? Thanks in advance!
@LlamAcademy8 ай бұрын
Sounds like maybe the ScriptableObjects aren't cloned properly and all are using the original?
@mattg13456 ай бұрын
Are you using the Unity Third person controller along side this?
@LlamAcademy6 ай бұрын
Yes that is the base for the movement and the model
@shirujsjs578 Жыл бұрын
Does the weapon work well for FPS? Or adjustments have to be made. Thanks for making such a complete tutorial.
@LlamAcademy Жыл бұрын
Yeah it should work for FPS. I saw a few people are using it in FPS scenarios successfully
@okandikkulak80572 жыл бұрын
Do you have a weapon manager video? I don't think there exists one on youtube. For choosing and equiping a weapon before the match starts, or as we spawn like in Valorant.
@LlamAcademy2 жыл бұрын
I’m thinking that in this series I may cover some kind of gun selector!
@ToughAndGrittyOpGrunts Жыл бұрын
Hi great tuturial ! which part do you show how to set up the IK script or do you have a seperate tuturial🙂
@LlamAcademy Жыл бұрын
I do not have the IK tutorial yet, but you can check out the project from GitHub and review this implementation as a quick and dirty get started point!
@ToughAndGrittyOpGrunts Жыл бұрын
@@LlamAcademy Brilliant thank you very much 🙂
@友贤 Жыл бұрын
Hi! I would like to say that this series of tutorials has been very well done and very helpful. And I have a question which is when I implemented this gun system into my project, I found that the trails that shoot out are biased to move upwards and look a bit unnatural in first-person view, is there any way to modify it to make the trail become more straight or fall slowly?
@LlamAcademy Жыл бұрын
The spread is based on your defined Vector3 (Simple) or Texture. If you feel the "upward spread" is too much, you can play with whichever option you have to lower the variance in that direction. Usually a gun does recoil up, so I would expect that to be one of the primary ways it does recoil 🤔
@bqnny1233 Жыл бұрын
Question: I love this implementation of yours because it's very flexible and can be built on top very easily, But I do have a problem. Most games have a gun-changing system or a gun equip system(the one where you can change the gun you are currently using at runtime). However your system doesn't support that, how could I modify it to let me do that? Sorry for the lack of proper punctuation and grammar, English isn't really my primary language.
@LlamAcademy Жыл бұрын
Swapping active guns may be a good topic to add to the series because it seems to be a highly requested topic. You can do a similar process to what is done in the PlayerGunSelector, or even reuse the logic from Awake when the player presses a button. If you have a game with a layout similar to Counter-Strike where you press 1,2,3,4 to swap weapons, you would just catch the key press, update the "Gun" to whatever is for that key, destroy the old gun, and re-run the Awake logic. Of course it would look better tying in animations, but that concept should get you started!
@bqnny1233 Жыл бұрын
@@LlamAcademy Thanks for the basic Idea, I'll try to implement it and if you don't mind, may I ask what is the next part after part 6 of the series going to cover?
@MaverickPlayer Жыл бұрын
Hi, I'm using your ScriptableObjectBased Gun System on FPS game. When I walk and shoot at the same time, the bullet trail came from behind the gun(kind of behind camera). I tried to fix it by changing the startPosition of Trail at the begginingof the BulletTrail Coroutine, but it was same result. And also, when walk left, walk right and shoot at the same time, bullet trail start from air too, Do you have any idea how to prevent from happening these. Thank you for your great tutorial.
@LlamAcademy Жыл бұрын
Hey! I think someone else asked about that in the comments of one of the videos, but I can't seem to find it now. In most games, this "problem" exists because the player and the gun are moving. Even though we spawn correctly from the barrel of the gun, that was at a snapshot in time. I looked into several other AAA games to see if this was something of an oversight that I had or what the deal was. It turns out even AAA games either: have this problem, or mitigate it by having extremely short bullet trails. The solutions I see are: 1. Leave it alone and have this "problem" - it can be mitigated somewhat by having smoke or something that comes out of the barrel afterwards to mask the effect. 2. Have very short lived bullet trails - player can't see the "problem" 3. Bind the start position constantly to the barrel of the gun (this results in "bending" of the trail which may not be desirable).
@MaximilianPs7 ай бұрын
Awsome but were I find the tutoria to make the StarterAsset as a Third Person Shooter? 😅😅
@avgchoobafan Жыл бұрын
i know this is a relatively old video but i wonder how can i change so instead of using the GunType enum to hold different guns, instead serve as a way to differentiate shooting modes, something like: enum GunType{ SemiAutomatic, Automatic, Burst } I think i should have different Shoot functions and use a Switch to select the shooting mode depending on what GunType the Gun is assigned to, but i'm afraid that having 3 functions with almost identical code is a bad way to do this, so i don't know how to approach this
@LlamAcademy Жыл бұрын
In my game to differentiate between burst and automatic I applied a modifier to the gun to adjust the mode, "number of bullets per shot", and increased the delay between shots by 3x. In the "Shoot" function all I did was check if it was "burst" and started a coroutine to spawn 3 bullets over the course of several frames instead of 1 in a single frame. The outcome is minimal changes to "Shoot" and the rest of the gun system remained unchanged. Later on in this Gun Series I cover a modifier and attachment system that can help achieve this effect (around part 9 & 10). I didn't do Semi-Auto in my game, but I think that is possible to handle by just tracking if the player has at least 1 frame where they were not pressing "shoot" then proceed with the current code flow
@OliverHosmerАй бұрын
I have a two errors Assets\Scripts\Gun\PlayerGunSelector.cs(15,12): error CS0246: The type or namespace name 'PlayerIK' could not be found (are you missing a using directive or an assembly reference?) & Assets\Scripts\Gun\PlayerGunSelector.cs(15,12): error CS0246: The type or namespace name 'PlayerIK' could not be found (are you missing a using directive or an assembly reference?) can some help plz Other than that its a good tutorial
@LlamAcademyАй бұрын
Please see top of description
@DeLaBerni Жыл бұрын
Hey one question which Third Person Controller Asset do u use ?
@LlamAcademy Жыл бұрын
I use the Unity Starter Assets Third Person Controller assetstore.unity.com/packages/essentials/starter-assets-third-person-character-controller-urp-196526 It's free!
@maitrykotak37039 ай бұрын
the problem i am having is i am having a virtual camera that follows character positioned at characters back....show only characterss back portion will show now during swipe code of look functionality of starter asset its rotating in every angle so may characters side and front portion is visisble ...is it possible that any swiping character also rotate on camera direction...so only back portion of character will be seen..please help
@bruhmanbruhmanzz10 ай бұрын
Does this project differentiate which kind of interaction to use for which weapon? Like how a glock is semi, an m4 is automatic, a laser gun is charge/release
@LlamAcademy10 ай бұрын
Not really. The gun system supports any of these, but the player interaction with the gun system is left to the implementer. If you would like these “fire mode”s I’d recommend to add that to the ShootConfigSO and read it on your “PlayerInput” and use that to determine if the gun.tick() should be called
@Healz4Life Жыл бұрын
Hey @LlamAcademy I was hoping to get the github version of this project working, as it was awesome to see it graciously provided and I was looking to compare my current system which has been built upon from your previous tutorials. I just had one problem, it doesn't seem to be explained how I go about importing Unity Particle Pack into the project without destroying the settings. Also awesome production quality on these videos B)
@LlamAcademy Жыл бұрын
Hi! Great question, and a common one. The Unity particle pack can be imported without overriding settings if you deselect all of the project settings files (they’re like the last ones). If you only select the folder about Effect Examples you will only get the particle systems, materials, and textures
@Healz4Life Жыл бұрын
@@LlamAcademy Thanks for the quick reply! Got it working great now as long as the hilarious aiming isn't caused by me, I could see this whole looking down+aim bull in a china shop movement mode working quite well if implemented as a feature XD CHARRRGE hahaga. As it's a common question it could be nice to have a quick explanation added to the github's "Quickstart", including updating materials. Looking forward to seeing how far this series goes!
@LlamAcademy Жыл бұрын
😁 the movement and aiming is not particularly well implemented. It was a quick hack job just to get something there while we implemented the core “gun functionality”. Coming soon - accurate crosshairs! Movement still will be crazy while aiming but the aim will be right. Sorry! I meant to say as well, I will update the readme with that info!
@MarekNijaki2 жыл бұрын
Awesome video! Just wish explanation would be little bit slower. My brain had to switch to second gear to keep with the pace of video. Other than that great job!
@LlamAcademy2 жыл бұрын
It's always a fine line to walk between "too fast" and "quit droning on and on". I'm generally a fast paced person so I guess it comes through in the videos sometimes 😅
@subequalpushup Жыл бұрын
tryed to put bullet prefab in but it wont let me
@Rsif87 Жыл бұрын
help
@LlamAcademy Жыл бұрын
Did you assign the bullet script to your prefab?
@joaodias8824 Жыл бұрын
I don't know if you're still answering comments on this video, bit if you do, after the Player gun selector script it gives me an error, the type or namespace name "PlayerIK" could not be found". I've looked in the GitHub that you provided but even with your code it still happened. Help would be appreciated
@LlamAcademy Жыл бұрын
Seems like you are missing the PlayerIK Script: github.com/llamacademy/scriptable-object-based-guns/blob/main/Assets/Scripts/PlayerIK.cs Cloning the repository fresh I did not get the error. Can you try to make sure you don't have any other compiler errors that prevented it from picking up the script? This is not mandatory and I don't even really recommend to use it in your production game. You can skip all code related to PlayerIK and still have the shooting working. It will just not have the hands tied to the gun.
@joaodias8824 Жыл бұрын
@@LlamAcademy Thanks, I'll test it out
@10saltedalmonds172 жыл бұрын
Hello, I am having an error with this line of code remainingDistance -= TrailConfig.SimulationSpeed * Time.deltaTime; It says that TrailConfigurationScriptableObject does not contain a definition for SimulationSpeed. Is there any import or something that i missed? Any ideas of how to fix this?
@LlamAcademy2 жыл бұрын
Seems like on the trail config you missed a step. Double check that section and what you have defined versus what is in the GitHub repository: github.com/llamacademy/scriptable-object-based-guns/tree/part-1
@l.g5390 Жыл бұрын
So if I not implement the part with the Surface Manager (the vid in the info) i have no visuals… so I have to watch the video and implement the surface manager etc right?
@LlamAcademy Жыл бұрын
You will not have impact effects, but you can also just pull the surface manager off GitHub. It’s included in this repository as well as the dedicated surface manager video repository.
@l.g5390 Жыл бұрын
Thanks a lot
@l.g5390 Жыл бұрын
( this shouldn't be a link
@duancoviero97592 ай бұрын
Genius!!! 🧐
@MTweedC4 Жыл бұрын
What just happend. 😭Im learning C# for about under a year now ... what must i do to become so heckin' good like you! Im amazed, honestly.
@LlamAcademy Жыл бұрын
😅 thank you for the compliment. Just keep working, practicing, and learning. You will get better!
@LostAngel1758 ай бұрын
Very Modularity, I like it.😂
@minq323 ай бұрын
Hi! thank you for this tutorial. I'm a newbie in unity coding so I followed each script closely but somehow still cant get the create -> guns menu show up on my end. I tried looking at the scripts from your github but it seems it's a more refined version of the scripts for later part of this tutorial series.. There's an error log saying "failed to find entry-points" with long logs under it (which I don't understand) If anyone encounter the same problem or have an idea on its solution, please help ;-; Update: I solved it but I have a question about the PlayerIK script as it won't show up on the inspector and gives error logs... please help ;-;
@scottmontgomery528 Жыл бұрын
Hey, thank you for the tutorial, I am new to unity and have tried to follow this for a couple of hours but have hit an issue, I'm not sure if it's due to me not using your SurfaceManager and Impact Manger, I have followed along and typed the code out exactly although I'm receiving this error while attempting to fire; NullReferenceException: Object reference not set to an instance of an object GunScriptableObject.Shoot () (at Assets/Scripts/Weapons/GunScriptableObject.cs:39) PlayerAction.Update () (at Assets/Scripts/Weapons/PlayerAction.cs:12) I've since tried copying your code from github and replacing the 6 files creating in this tutorial but I had the exact same error so I think I have missed something in the setup in Unity but I'm at a loss as to what if you have any advice I'd appreciate it. I've also tried importing Unitys particle system as recommended to another commenter but it didn't change anything.
@LlamAcademy Жыл бұрын
Can you give me the code at line #39 of GunScriptableObject.cs? From the repository on part 1 that is not a line that can give any error. If it is: Vector3 shootDirection = ShootSystem.transform.forward + .... It is important that your Gun model has a Particle System as a child of it and is positioned at the tip of the barrel. This is where all bullets will spawn. If you do not do this, ShootSystem will be NULL and give you that error. We assign ShootSystem on Setup() by doing: ShootSystem = Model.GetComponentInChildren(); which requires that the Particle System is a child of the instantiated gun prefab model.
@LlamAcademy Жыл бұрын
Let me know if you run into any issues after doing that!
@bobertbwild13504 ай бұрын
Ive finished the code, im having trouble with line 42 of gunscriptableobject shoot() saying object refernce nnot set to an instance of an object. i need help :(
@LlamAcademy4 ай бұрын
Do you have a particle system as a child of the gun?
@minq323 ай бұрын
I have the same issue ;-;
@maitrykotak370310 ай бұрын
trails is creating nicely but they are created far from pistol,,,,not from the pistol...is there any solution?
@LlamAcademy10 ай бұрын
Are you assigning their start position to the gun particle system as soon as you spawn them?
@bbrainstormer2036 Жыл бұрын
Hey! This tutorial looks great, but when I download it from Github, it keeps giving me errors. I think the issue is with the MuzzleFlash particle system in the gun previews
@LlamAcademy Жыл бұрын
Did you import the Unity Particle Pack after cloning from GitHub?
@bbrainstormer2036 Жыл бұрын
@@LlamAcademy Yeah, but they don't work with URP Edit: the render pipeline converter solves the issue
@LlamAcademy Жыл бұрын
@bbrainstormer2036 awesome to hear!
@whysl2 жыл бұрын
I don't know how to fix that problem... Can anybody help? GunScriptableObject.cs(9,9): error CS0246: The type or namespace name 'ImpactType' could not be found (are you missing a using directive or an assembly reference?) PlayerGunSelector.cs(16,10): error CS0246: The type or namespace name 'PlayerIK' could not be found (are you missing a using directive or an assembly reference?)
@LlamAcademy2 жыл бұрын
Hi 👋. The impact system won’t be covered in this series because it was covered in this video: kzbin.info/www/bejne/oYWVi6uggtqHlZY The full projects for all my videos are available on GitHub, so you can download those scripts from here: github.com/llamacademy/scriptable-object-based-guns (links also in description). Since this video is part 1 only, you may change the branch to “part-1” to only see what you see here. Good luck!
@medopizza9 Жыл бұрын
the Object pool keeps showing this error: "The type or namespace name 'ObjectPool' could not be found (are you missing a using directive or an assembly reference?)"
@LlamAcademy Жыл бұрын
We’re using the Unity 2021 object pooling system here. As long as you are on 2021 LTS or higher you should be able to add “using UnityEngine.Pool;” at the top of the script and it should work for you.
@shubhamdhumal7578 Жыл бұрын
this work well can we do this for mele combat swords and hand
@shadowartz9968 Жыл бұрын
Mr. Chris sorry to bother you but where on github can I download all the most recent scripts for this shooting project. I thought I downloaded all the scripts but the code has errors in surface manager and a few other places
@LlamAcademy Жыл бұрын
Hi! If you download the project from github.com/llamacademy/scriptable-object-based-guns and follow the setup instructions there (downloading Unity Particle Pack for example) it should work with no errors. Each video has a branch with exactly what you saw on that video. For this one, at the top left where you see a dropdown that says "main" you can change that to "part-1" and it will reflect exactly where this video ended. If you download the latest "main" and it has some errors, can you share those exact error messages along with your version of Unity so I can troubleshoot those? It should be very easy to get working.
@shadowartz9968 Жыл бұрын
@@LlamAcademy Thank you for your help that worked.
@Jemmeh Жыл бұрын
Thank you for the video! Small bit of feedback the music is a tad loud and it makes it harder to understand you. If anything I'd prefer no music, especially any time there's an editor open. I've had to rewind a good bit 😅
@LlamAcademy Жыл бұрын
Thank you for the feedback, I thought I had it at a low enough volume to not be distracting but apparently not! I will keep that in mind in the future.
@Jemmeh Жыл бұрын
@@LlamAcademy Appreciate you hearing me out!
@Chris-yq1fwАй бұрын
Hi, I think the system is not that extensible, the gunSO would not work as expected because only one of its kind is allowed to spawned in the scene, what if your enemies also have that same gunSO ?
@LlamAcademyАй бұрын
We are cloning the SO so each individual user of a gun has their own instance of a gunSO that can be configured as needed
@Chris-yq1fwАй бұрын
@@LlamAcademy Hi Chris, thanks for your answer, just to clarify, to clone the SO we have to change from this - gunSO = guns.find(...); - gunSO.Spawn(...) to this ? - gunSO = guns.find(...); - newGunSO = Instantitate(gunSO) - newGunSO.Spawn(....)
@LlamAcademy29 күн бұрын
Sorry. I don't think in this video we got into cloning the SOs in this video. Yes, you will need to do something like that. I don't remember the exact video but later on in this series we get into that, probably when we get into modifiers/attachments.
@Chris-yq1fw29 күн бұрын
@@LlamAcademy Many thanks, good day!
@Toeknuckles2 жыл бұрын
awesome tutorial man! I've been looking for this exact kinda tutorial since like last week! 😅 Got a noob question for you, Is there a way to apply damage to a gameobject based on where the bullet trail ends up actually hitting? Just trying to see if I can simulate projectile based weapons but with raycasts so players could effectively dodge bullets if they get out of the way of the bullet trail before it makes contact with them? 🤔
@LlamAcademy2 жыл бұрын
You could do something like Physics.OverlapSphere or OverlapBox after the trail reached the target location to be sure the object is still within range of error to count as a hit. Assuming you have fast moving objects, by the time the trail got there the object could have moved too far away to count as hit and you could continue the trail as though it missed altogether
@Sergon-23 Жыл бұрын
Hello, does anyone know in what video does he implement the IKs for the gun holding animations? Thanks in advance!
@LlamAcademy Жыл бұрын
#12 Aiming with Inverse Kinematics (IK) and Animation Rigging | Gun Series 12 | Unity Tutorial kzbin.info/www/bejne/mZnKfYWgiMaijsU
@Sergon-23 Жыл бұрын
@@LlamAcademy thank you, good sir! Have a nice day!!!
@emilbejstrup4956 Жыл бұрын
I am a new developer so please bare with me. If I used this approuch in a multiplayer game, wouldnt I run into trouble if two players used the same gun as they would share the clipsize?
@LlamAcademy Жыл бұрын
No, there would not be an issue there. Each player would have their own copy of the ScriptableObject that is being manipulated in that case!
@pritiguptaraina30838 ай бұрын
I decided to cut out InverseKinematics since i'm using Unity Personal, so i really can't do it. If there is a workaround, please tell thee.
@LlamAcademy8 ай бұрын
There's no limits to functionality within Unity. You can be on Personal and still use this fully.
@mystocity Жыл бұрын
I also still have playtrail does not exist in the current context should that still be there
@drake_eric97996 ай бұрын
How can I application quit in build I know the editorial application quit application.quit() in build not working
@kiboslams Жыл бұрын
I am getting errors saying Assets\GunScriptableObjects.cs(135,50): error CS1002: ; expected Assets\GunScriptableObjects.cs(119,15): error CS1513: } expected Assets\GunScriptableObjects.cs(119,15): error CS1002 ; expected Assets\GunScriptableObjects.cs(52,48): error CS1001: identifier expected Can you put the scripts in a GitHub, or type it in the Description because i have no idea what this means :/
@LlamAcademy Жыл бұрын
It is on GitHub and the link is in the description
@InvisaPotion Жыл бұрын
Yo I added the trail but sometimes the trail for a bullet will just shoot off to the side and stretch out, is there any way to fix this?
@LlamAcademy Жыл бұрын
Hmm.... usually the only way I can get that to happen is if I don't wait a frame before reactivating the TrailRenderer. Can you compare what you have to what is on Github: github.com/llamacademy/scriptable-object-based-guns/tree/part-1 ? And if you get the same behavior with that, show me a short video of what is happening and what configuration you are using?
@kivivikix9 ай бұрын
@@LlamAcademy I'm having this same issue, the trail shoots to the last shot position and the new shoot position at the same time resulting in 2 rays. Sometimes there is a ray that shoots at totally random direction. I have no idea how to fix that.
@kivivikix9 ай бұрын
instance.transform.position = StartPoint; I was missing this line
@seafood3237 Жыл бұрын
I'm getting this error: " NullReferenceException: Object reference not set to an instance of an object at UnityEngine.Rendering.Universal.UniversalRenderPipeline.SetupPerFrameShaderConstants () [0x00089] in :0 at UnityEngine.Rendering.Universal.UniversalRenderPipeline.Render (UnityEngine.Rendering.ScriptableRenderContext renderContext, System.Collections.Generic.List`1[T] cameras) [0x00065] in :0 at UnityEngine.Rendering.RenderPipeline.InternalRender (UnityEngine.Rendering.ScriptableRenderContext context, System.Collections.Generic.List`1[T] cameras) [0x0001c] in :0 at UnityEngine.Rendering.RenderPipelineManager.DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset pipe, System.IntPtr loopPtr, UnityEngine.Object renderRequest) [0x00046] in :0 " when i'm playing on build
@LlamAcademy Жыл бұрын
This seems like it an error related to URP 🤔 not sure
@vuxenn Жыл бұрын
When i try to change active gun while game is running it says "The variable ShootSystem of GunScriptableObject doesn't exist anymore." what can i do to change my gun while game is running
@LlamAcademy Жыл бұрын
That's a more complex answer than I can probably reasonably do in a comment. I am planning on adding a video in the series about weapon swapping because that is a very commonly requested topic!
@isagunenc4484 Жыл бұрын
I did the same thing you did in the video, but it didn't work, only the gun was on the player's body. I deleted them with impcat type , player ik or something . Can you post the player ik script file? and can you solve this problem of mine please because we will enter the game contest
@LlamAcademy Жыл бұрын
The full project is on GitHub. You can check out the whole thing working together. Link’s. In the description
@walkingdead8331 Жыл бұрын
is it possible to do trail without object pooling because i am in 2020 and i cannot access unity object pool
@LlamAcademy Жыл бұрын
I would really recommend to use some form of object pool for this. In my earlier videos when 2021 wasn't out I made a simple one you can use (video: kzbin.info/www/bejne/nKSndpKjhJmFkK8 code: gist.github.com/llamacademy/e3ed9e647b2c703d698a809d00a112a8 ) If you don't want to, you can use Instantiate/Destroy instead of getting objects from the pool and disabling them.
@DeLaBerni Жыл бұрын
Hey what is this SurfaceManager ? I dont have that ..
@LlamAcademy Жыл бұрын
It's how we manage impact effects. That was covered in a separate video and has a dedicated github repo. More details in description and the pinned comment.
@gamernabilalabadi62402 жыл бұрын
can some one help me? in 11:30 he use SurfaceManager by mine script dont work
@LlamAcademy2 жыл бұрын
The SurfaceManager is done in another video, linked in description. You can skip that if you do not need impact effects at this time.
@ginoantenucci6424 Жыл бұрын
11:38 I don’t have the surface manager nor the impact type
@LlamAcademy Жыл бұрын
Hi. There’s several comments around this one. In this video I DO NOT cover the Impact System: kzbin.info/www/bejne/oYWVi6uggtqHlZY you can check out that video for the full explanation for how that works. In there we create the SurfaceManager and ImpactType. If you don’t care yet about impact effects, you can safely skip those and you will still be fine 💪
@ginoantenucci6424 Жыл бұрын
@@LlamAcademy yeah just saw that😅 great vid very good system
@abcdgamingandcreations2104 Жыл бұрын
I have an issue when im firing the trail is instantiation from the ground
@LlamAcademy Жыл бұрын
Make sure you have the particle system at the tip of the gun and when you are spawning the bullet to set the spawn point to be at the same point!
@abcdgamingandcreations2104 Жыл бұрын
@@LlamAcademy yea thanks I fixed
@il_bert0354 Жыл бұрын
Hi, i'm getting this error "MissingReferenceException: The variable shootSystem of SO_Gun doesn't exist anymore." after a few seconds on play mode, but i don't know how to fix it, somebody can healp me?
@LlamAcademy Жыл бұрын
Sounds like maybe your gun prefab doesn't have a Particle System as a child of it
@il_bert0354 Жыл бұрын
@@LlamAcademy thx for the fast answer, the problem was that i has the particle system, but my dumb-ass did not called it in the gun script…thx again
@francescogerlin80062 жыл бұрын
Can i transform this to use it for a doom clone game?
@LlamAcademy2 жыл бұрын
I don’t see why not 🙂
@armandoaguilarreyes1087Ай бұрын
does someone know where can i get the IK and the doll that he is using in this video?
@LlamAcademyАй бұрын
Please see top of the description
@armandoaguilarreyes1087Ай бұрын
@@LlamAcademy i see it, thanks , btw im having a mistake with the prefabs, MuzzleFlash01 is missing, the model suposse to have it right? i download the github`s First version but is has the same problem
@armandoaguilarreyes1087Ай бұрын
I`v seen the read me doc and i could fix that problem, but still li light is pink, and i dont know where to get other particle to switch
@ghostzone985 Жыл бұрын
Are you sure that everything has been commited o github? I am facing NullReferenceException on GunScriptableObject.cs:294 and PlayerAction.cs:46 right away. It seems that ShootSystem is missing
@LlamAcademy Жыл бұрын
Looks like you didn’t import Unity Particle Pack. Make sure you review the setup instructions in the readme!
@mdekram6792 Жыл бұрын
I don't know how to fix the problem. Please somebody help me Null reference not set to an instance of an object GunScriptableObject.Shoot().cs:246
@LlamAcademy Жыл бұрын
Hmm… from this video GunScriptableObject does not have 246 lines of code. Can you please review your implementation compared to the part-1 branch? github.com/llamacademy/scriptable-object-based-guns/blob/part-1/Assets/Scripts/Gun/GunScriptableObject.cs
@dekenfnombre9143 Жыл бұрын
wb knife throwing projectile?
@LlamAcademy Жыл бұрын
You could probably handle that here as well with a low rate of fire and customized animation. Projectiles are covered in Part 6 of this series!
@vergincore Жыл бұрын
I keep getting errors saying "The name 'instance' does not exist in the current context" did I miss something?
@LlamAcademy Жыл бұрын
“Instance” should be capitalized. But for the surface manager, it’s not covered in this video. You can copy/paste the Surface Manager scripts from the repo: github.com/llamacademy/scriptable-object-based-guns/tree/main/Assets/Scripts/Surface%20Manager Or, to understand the implementation you can watch that video: kzbin.info/www/bejne/oYWVi6uggtqHlZY
@vergincore Жыл бұрын
@@LlamAcademy alright, thank you! I just kind of assumed such a generic word like Instance would already be used by unity!
@vergincore Жыл бұрын
@@LlamAcademy alright one more question, got those errors fixed by going through the impact video, but now i get the error "UnassignedReferenceException: The variable ShootSystem of GunScriptableObject has not been assigned."
@Byteezexe Жыл бұрын
What do i do to get the surface manager?
@LlamAcademy Жыл бұрын
You can check it out from this project or the dedicated Surface Manager github. Those are all linked in the description.
@Byteezexe Жыл бұрын
ok thanks@@LlamAcademy
@GameDevs_Life Жыл бұрын
does anyone know how to fix surfacemanager error ? , it would really helpfull
@LlamAcademy Жыл бұрын
Please check pinned comment
@anonymoussloth6687 Жыл бұрын
How do games make gun skins? Sometimes, the skins make the gun very different than the original gun. Example: valorant. Skins make guns have different trails, recoil, textures, even different models of the same gun
@LlamAcademy Жыл бұрын
In the most recent videos in the series, we build out the systems to enable exactly what you're talking about. For a Skin, you can apply the same concept as any other modifier, where it can also apply a different shader or material to the gun.
@anonymoussloth6687 Жыл бұрын
@@LlamAcademy hi, thanks for your reply. But what about guns that have completely different mesh for skins? Like in valorant, many guns have skin specific components
@LlamAcademy Жыл бұрын
Sounds likely they just have a different prefab with the same base model and each skin can have fancy other attachments or different materials
@NolanCoe Жыл бұрын
Anybody else having some trouble with "The type or namespace name 'PlayerIK' & 'ImpactType' & 'SurfaceManager' could not be found"?
@LlamAcademy Жыл бұрын
Yes. Please see pinned comment
@MASTONGAMES2 жыл бұрын
I want to do this with netCode... I didn't find anything about it...
@LlamAcademy2 жыл бұрын
There's generally 2 approaches with networked games: 1 do the Raycast on the server based on server-synchronized positions of players / guns and send an RPC/message to clients that the shot was fired from point X to point Y and have the clients only handle the rendering. 2 do the raycast on the client and send a message to the server that it hit something and have the server validate if that's reasonable (that's the hard part 😉- you can skip this but it makes it really easy to cheat). #1 is harder to cheat with, #2 "favors the shooter" which can feel more responsive.