ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

Equip and Switch Multiple Weapons in Unity 2D | Weapon System Unity 2D

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ส.ค. 2024
  • Consider donating to help me keep this channel and website alive : paypal.me/supp... 💖
    or Support me on Patreon : / the_game_guy 💖
    In this video im gonna show you how to equip multiple weapons and switch between them using Q and E keys. We will learn how to make a dynamic weapons system so that we don't have to make any changes for more weapons. You can add as many weapons as you want.
    But before you watch this video I recommend you watch my previous video where i show you how to make a 2D gun and shoot bullets with it, with all the gun settings such as fire rate, recoil, bullets speed and stuff.
    Check out the video here : • How to make 2D Shootin...
    and here are some more tutorials which might be useful :
    How to throw knife in UNITY :
    • How to throw knife usi...
    How to make an AWESOME game Menu :
    • How to make an AWESOME...
    How to make level saving System :
    • How to make a simple L...
    Remote Configuration by BRACKEYS :
    • CHANGE YOUR GAME ANYWH...
    Game difficulty by Brackeys :
    • Difficulty in Video Ga...
    How to make first person game in UNITY by BRACKEYS :
    • MAKING YOUR FIRST FPS ...
    Some interesting and fun Unity videos by DANI
    I made an evil bot my friend :
    • I Accidentally Made an...
    I turned TH-cam into giant battle royal game :
    • I Turned TH-cam into ...
    I made a game in 30 Minutes :
    • Making a Game in 30 Mi...
    Music: www.bensound.com 🎵

ความคิดเห็น • 49

  • @TheGameGuy
    @TheGameGuy  3 ปีที่แล้ว +8

    For the *Copy/Paste gang* 😜
    Grab the assets from : thegameguy.net/resources.html

  • @wenddels
    @wenddels 2 ปีที่แล้ว +2

    I wish i could find more tutorials like yours. Thank you so much

  • @bungercolumbus
    @bungercolumbus 3 ปีที่แล้ว +1

    Here's a tip. You don't need to make a public gameObject for the object the script is attached to. You can simply write gameObject. For example the weaponHolder gameobject didnt need that since the script was already attached to the weaponholder.

  • @brejnastore
    @brejnastore 3 ปีที่แล้ว +3

    Tip: when u have shot sound and fast switch weapon sound will be disabled with weapon so add sound to the player

  • @user-si5lr6mw4d
    @user-si5lr6mw4d 3 ปีที่แล้ว +2

    You should put currentGun =currentWeaponsIndex out of the if statements.. So that it updates it automatically and you dont have to type it in every if statement for weapon change..Same goes to some other lines that you wrote.. You win about 5-6 lines (around 67-92KB)

    • @vgmz59
      @vgmz59 2 ปีที่แล้ว

      can you please rewrite the code

  • @user-ig6tr2en3s
    @user-ig6tr2en3s 2 ปีที่แล้ว +1

    I am learning well.
    If weapon replacement is implemented in 3D rather than 2D, where and how can I change the code in the video?

  • @perssontm1628
    @perssontm1628 2 ปีที่แล้ว +1

    Is there any simple way to drop and pickup your weapons aswell? This would REALLY help me please I really need this

  • @toxicrebel42o
    @toxicrebel42o 2 ปีที่แล้ว +1

    anyone know how one would do this but make it so the player can only hold two weapons max and then drop/swap the current weapon for one on the ground with a key press like Call of duty. a reply or a link to a video that would help me do this is appreciated. plz & thx

  • @citysuperstar2945
    @citysuperstar2945 11 หลายเดือนก่อน

    i love you. that was an amazing tutorial.

  • @klerisbiba5089
    @klerisbiba5089 3 ปีที่แล้ว +1

    hello i'm currently making a stickman game and I want to put the mechanic that when you touch a weapon you pick it up. Can somebody help me

  • @youtubechalao1580
    @youtubechalao1580 3 ปีที่แล้ว +3

    LOVED IT!! can you do weapon pick up and drop too?

    • @Arthan81
      @Arthan81 3 ปีที่แล้ว +2

      Yeah me too

    • @ballkicker2391
      @ballkicker2391 3 ปีที่แล้ว

      me too couldnt find anything on the internet so I'm making my own now >_

    • @perssontm1628
      @perssontm1628 2 ปีที่แล้ว

      Yeah I feel like if you do this kind of video you should cover it all, weapon firing, hotbar slots, drop and pickup. It would be the best video out there

  • @Jedroy52
    @Jedroy52 2 ปีที่แล้ว +1

    Thank you)

  • @retekcorp
    @retekcorp 3 ปีที่แล้ว

    I tried to apply this and the previous tutorial to my ragdoll stickman, but it doesn't work! Maybe make a weapons tutorial for stickman like Stick Fight the Game?
    Great video, overall!

  • @Jerry742-CH
    @Jerry742-CH ปีที่แล้ว

    Thank you

  • @sheerazali5178
    @sheerazali5178 3 ปีที่แล้ว

    Keep up the good work

  • @susyballs329
    @susyballs329 2 ปีที่แล้ว

    I need Help my problem is make a 3d game and when i move the cam only the first weapon cam moves when i change to the second the cam is not moved

  • @a.technology1446
    @a.technology1446 3 ปีที่แล้ว +1

    Great ❤️

  • @deadbroadcastpc
    @deadbroadcastpc 3 ปีที่แล้ว

    Very informative, thanks for the tutorials man!

  • @KannieGamen
    @KannieGamen 3 ปีที่แล้ว

    is there a way to holster the weapons on the player? like a shotgun on your back

  • @RHCIPHER
    @RHCIPHER 3 ปีที่แล้ว

    you are the best

  • @Arthan81
    @Arthan81 3 ปีที่แล้ว +1

    Hey can you make a drop item and enquip item? Its ok if you can not if can i will wait

    • @TheGameGuy
      @TheGameGuy  3 ปีที่แล้ว +2

      Sure why not.

    • @blobbyhead1373
      @blobbyhead1373 3 ปีที่แล้ว

      @@TheGameGuy when will you make it

    • @toxicrebel42o
      @toxicrebel42o 2 ปีที่แล้ว

      @@TheGameGuy have u done this yet? im looking to use this in a way like COD does where i have two weapon slots but can swap them with ones on the ground and ones dropped by other players/npc

  • @Arthan81
    @Arthan81 3 ปีที่แล้ว

    Thx man

  • @raidoksgames3510
    @raidoksgames3510 3 ปีที่แล้ว +1

    In the last video You had Player Shot Script . But now is shootingScript . What you changed?

    • @raidoksgames3510
      @raidoksgames3510 3 ปีที่แล้ว +1

      In codes

    • @TheGameGuy
      @TheGameGuy  3 ปีที่แล้ว

      I just took out some of the gun settings from the previous script as i lost my project.. rest of the script works in the same way, you can just use the previous script without any changes to the code..

  • @c0b0exe
    @c0b0exe 3 ปีที่แล้ว

    anyway to edit this script for if the player is picking up weapons and starting with none?
    trying to figure out how to make the array search in update but I can't get it to work properly

  • @atthoriqadillahwicaksana3554
    @atthoriqadillahwicaksana3554 3 ปีที่แล้ว

    hey, i watched your previous video about how to shoot, but here i saw a lot of gaps in your tutorial. for instance, in the previous video your shooting script, i saw the bullet speed, shoot point, etc. but here it moved in the particular weapon. can you please explain it?

    • @TheGameGuy
      @TheGameGuy  3 ปีที่แล้ว

      yeah, thats cuz i lost the previous project and made a simpler version of it.. but no worries, itll work in the same way you'll just have more gun settings for your gun if you follow my tutorial..

  • @raidoksgames3510
    @raidoksgames3510 3 ปีที่แล้ว

    How you can add Sound shoot ?

  • @MarkJrLuat
    @MarkJrLuat 3 ปีที่แล้ว

    Nice vid! But how do I make it so I can switch the weapons with the scroll wheel

    • @toxicrebel42o
      @toxicrebel42o 2 ปีที่แล้ว

      did u solve this?

    • @francescogerlin8006
      @francescogerlin8006 ปีที่แล้ว

      You can use if(Input.GetAxis("Mouse ScrollWheel")) instead of the E key

  • @Juan-rb5uv
    @Juan-rb5uv 3 ปีที่แล้ว

    Deberias hacerlo para los celulares

  • @oliverwilson5796
    @oliverwilson5796 2 ปีที่แล้ว

    How Can I use this script with a touch button?

  • @dfcdw5937
    @dfcdw5937 3 ปีที่แล้ว

    how many game do you make and publish on play store

    • @TheGameGuy
      @TheGameGuy  3 ปีที่แล้ว +1

      i have made quite alot of games over the years but only published a couple games on play store.

    • @dfcdw5937
      @dfcdw5937 3 ปีที่แล้ว +1

      @@TheGameGuy sorry but i want to ask that can google play ban our developer account if we publish our games which are not interesting and not good . i mean flop games

    • @mintesnotmelese6552
      @mintesnotmelese6552 3 ปีที่แล้ว

      @@dfcdw5937 NO you can upload by game (Even if it's shit
      )

  • @deeptiyadav923
    @deeptiyadav923 3 ปีที่แล้ว

    Thanks copy paste gang go brrrrrrrrrr

  • @CloudC-kj6kt
    @CloudC-kj6kt 3 ปีที่แล้ว

    10min video 4 min ads