Easy Ammo & Reloading System in Unity
Setting up an Ammo system is just creating a few integer variables and doing a check or 2. Reloading might seem a little more complicated, but can be done in just a few lines of code.
In this 2d Unity Tutorial learn how to setup a really easy ammo and reloading system you can adapt to your game. It works really well.
I build this off of my 5 Minute Top Down Shooter tutorial, so do that first if you want to have a project setup like I do.
➤5 Minute Top Down Shooter Tutorial: • 5 Minute Top Down Shoo...
✨Want to support the channel?
Buy me a coffee ☕: ko-fi.com/bmoli
➤SUBSCRIBE to inflate my ego with a bigger number 💖
➤LIKE the video to help the algorithm or else I'll..... reload you? I got nothin this time
➤Join our DISCORD SERVER and be best friends: / discord
Thanks for watching!
#unity #tutorial #bmo
Пікірлер: 21
Dude. I don’t think you understand how amazing your channel is. The quality to quantity is completely unmatched. You are a unity tutorial power house and I can’t thank you enough for the content you have blessed me with. Funnily enough, I don’t even need this specific tutorial for my current project, I don’t even plan to add guns, but I just wanted to say thank you for what you have released and I hope you continue to share your wisdom upon us all :) again, thank you.
Great video! Just in case someone finds this useful, the reloadAmount could also be calculated with the "min" function: reloadAmount = Mathf.Min(maxClipSize - currentClip, currentAmmo);
@kkkyloo
Жыл бұрын
thanks
Thank you for all of the amazing tutorials you’ve put out so far! :)
Just the video I needed! Thank you so much!!
Nice timing, I was just starting to work on weapon ammo pickups xD, you are the BEST!
Thanks for the video! I made it so there is no ammo, just the clip in the gun and it reloads automatically at 0 or if the player presses r. Also made it so you can hold down left click to keep shooting at a specified fire rate, works pretty good!
Thank you for this tutorial!
You are the best keep it up 👍
Just trying to set up weapons. Made 2 using particle system tried to add a swap weapon into it a broke it all... this was my next step hahaha hopefully I can fix it then im dying to get onto this haha
Im learning c # and i was doing console scripts, I was able to make an ammo pickup function but I was having sooooo much trouble figuring out how to keep the reload function from going negative, this solved my problem! Thanks! I know its basic math but it gets confusing.
Sick!
Better than brackey's!
youre soooo fucking great dude! so understandable and helpful, greetings from germany!
you make it seem so easy my little breakfast quiche
Hi, this tutorial works great. However, how would you be able to retain the values (how much ammo you have, how much is in the gun, etc) between scenes? Everything resets when leaving the intital scene and going to another.
Can you Make one for stats interaction like attack power and defense/dodge crit etc
Any chance you can do a SPIRAL STAIRCASE in 2d.I can only get one way working as the colliders block other way..I've using 2d one way effector.is there an other way?
Can this be used in multiple weapons?
how do I save ammo value on disabling and enabling the weapons? as of now it only resets the value that I set in Start function
You can send script