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

  • @i_am_set
    @i_am_set2 жыл бұрын

    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.

  • @mateoballa149
    @mateoballa1492 жыл бұрын

    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

    @kkkyloo

    Жыл бұрын

    thanks

  • @miladyghost
    @miladyghost2 жыл бұрын

    Thank you for all of the amazing tutorials you’ve put out so far! :)

  • @frostyflankz120
    @frostyflankz1202 жыл бұрын

    Just the video I needed! Thank you so much!!

  • @GBSCronoo
    @GBSCronoo2 жыл бұрын

    Nice timing, I was just starting to work on weapon ammo pickups xD, you are the BEST!

  • @robbybobbijoe
    @robbybobbijoe Жыл бұрын

    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!

  • @drewlong3201
    @drewlong3201 Жыл бұрын

    Thank you for this tutorial!

  • @Crazyfamlam
    @Crazyfamlam2 жыл бұрын

    You are the best keep it up 👍

  • @NotSoSeriousGaming
    @NotSoSeriousGaming2 жыл бұрын

    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

  • @javiflores5896
    @javiflores58962 жыл бұрын

    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.

  • @Stompin40
    @Stompin402 жыл бұрын

    Sick!

  • @atharwa46
    @atharwa46Ай бұрын

    Better than brackey's!

  • @justusisbestest4122
    @justusisbestest41222 жыл бұрын

    youre soooo fucking great dude! so understandable and helpful, greetings from germany!

  • @T3QN1Q
    @T3QN1Q2 жыл бұрын

    you make it seem so easy my little breakfast quiche

  • @stuffedmannequin
    @stuffedmannequin5 ай бұрын

    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.

  • @lokosstratos7192
    @lokosstratos71922 жыл бұрын

    Can you Make one for stats interaction like attack power and defense/dodge crit etc

  • @random_precision_software
    @random_precision_software2 жыл бұрын

    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?

  • @safin_lol
    @safin_lol2 жыл бұрын

    Can this be used in multiple weapons?

  • @atharwa46
    @atharwa46Ай бұрын

    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

  • @Glasraf
    @Glasraf5 ай бұрын

    You can send script