Ability Bar in Unity (Swap Weapons/Items)

Поделиться
HTML-код
  • Опубликовано: 27 дек 2024

Комментарии •

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  5 лет назад +6

    Drag and Drop any ability you want! Great for any game with multiple weapons/abilities or something like WoW or Terraria!
    🎮 Play 7 Awesome Games (Action, Strategy, Management) and Help Support the Channel!
    ✅ Get the Game Bundle 67% off unitycodemonkey.com/gameBundle.php

  • @Michael_Diago
    @Michael_Diago 5 лет назад +11

    Just started my game development journey. I appreciate you making these videos to help guide me along 👾

  • @speedrob
    @speedrob 5 лет назад +5

    Very nice, another top quality tutorial.

  • @Andrew90046zero
    @Andrew90046zero 5 лет назад +5

    I love how it seems like all the recent videos are of stuff that I’m currently working on with my project xP
    But I enjoy seeing how you implement things vs how I would do it.
    Idk if you saw my reply from a few videos ago, but if your interested I have found out how to make a lit sprite shader that can selectively “self-emit” based on a mask that can be used to make parts of the sprite visible without needing a light source. Like glowing lava. I didnt want to bother you with a DM on discord, but if your interested let me know.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 лет назад

      I think I saw you lava gif somewhere, I've recently been researching more about Shader Graph and yup discovered the various uses for the Mask field. Thanks!

  • @SirDMX
    @SirDMX 5 лет назад +3

    awesome tutorial

  • @あれくす
    @あれくす 4 года назад +3

    How would you apply this to dragging and dropping spell/abilities from a spell book to set the hotkey abilities? Lets say I had a spellbook the player could open with an interface and from there they could then drag and drop the icon which would then tell the hotkeybar what spell belongs in that hotkey slot?

  • @neozoid7009
    @neozoid7009 2 года назад +2

    how different weapons are implementing in the script , please help . I really want to know about the weapons . Are the built into sprites or are they different objects ? or is it a modular system??? waiting for the reply. As always your scripting logics are awesome super clean and versatile I love to learn from you.

  • @brianwaltse281
    @brianwaltse281 4 года назад

    Great work! Thanks for the info!

  • @457Deniz457
    @457Deniz457 5 лет назад +1

    AS ALWAYS !
    Thanks :)

  • @ikiller_eg
    @ikiller_eg 5 лет назад +1

    You are the best 😘 thank you

  • @СергейПо-х2и
    @СергейПо-х2и 3 года назад

    6:47 So you declared "instance" of AbilityType enum Then adds it to the List What reason is of it? If you are passing another "argument" of "WeaponType" enum You never used "abilityType" instance (link) You should pass "activateAbilityAction = ()=>player.setWeaponType(abilityType)" or you just could pass directly "player.setWeaponType(AbilityType.Pistol)" P.S I consider you just forget to change

  • @Milanyd_
    @Milanyd_ 3 года назад +1

    Hi Code Monkey, is there a way to disable a weapon thru code like an if weaponactive == true and than make the weapon appear in the ability bar and if there is a way how would i do it?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 года назад

      Sure, you can enable or disable Game Objects with gameObject.SetActive();

  • @Bruno-mq5ss
    @Bruno-mq5ss 4 года назад +1

    I'm very late but, how can I make that when I pick up the gun or object y goes to the slot and in the slot press the Alpha keys to have it?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 года назад +1

      You need to combine the hotkey bar with some sort of inventory system
      ruclips.net/video/2WnAOV7nHW0/видео.html
      ruclips.net/video/isAmoM3RPEI/видео.html

  • @benimaru5444
    @benimaru5444 5 лет назад +2

    I really hope that you will make *if You already not* an Udemy course,but course that contains all lessons that a begginer game developer needs to have.
    P.S You and Brackeys made me start game developing
    GL

    • @casualgermans
      @casualgermans 5 лет назад

      Actually, udemy is a ripping off content creators. You only get a good chunk of the money of they come through the link the creator provided, otherwise udemy takes like 50-75% of the revenue.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 лет назад +1

      Yeah at some point I want to make a really in-depth course going from complete beginner to intemediate.
      Glad to hear you started game dev, keep at it!

    • @benimaru5444
      @benimaru5444 5 лет назад +1

      @@casualgermans I said Udemy because I dont know any other website with content like that

  • @MultiPss
    @MultiPss 3 года назад

    Followed until 13:33 but my UI seems to be not appearing both on the Scene and the Game. No errors. The UI is still instantiated as intended, it's just everything become invisible. I don't know if you are going to reply a 2 year old video. I hope anyone see this can help me. (using Unity 2020.3)
    Edit 1: I already check the Instantiated UI, everything should be Instantiated correctly, all the images and sprites is there on the inspector. but it is somehow invisible.
    Edit 2: The problem seems to be the UI is not Instantiated under Canvas
    Edit 3: Fixed the problem by add a tag to the canvas, and change the code to
    Transform abilitySlotTransform = Instantiate(abilitySlotTemplate.transform, GameObject.FindGameObjectWithTag("Canvas").transform);
    Hope this helps anyone!

  • @СергейПо-х2и
    @СергейПо-х2и 3 года назад

    what script editor do you use?

  • @cybertech1076
    @cybertech1076 2 года назад

    Hey, How Would You Implement This With Your Inventory System You Made Previously?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +1

      For the hotkeyability callback you would just hook that onto the item.Use(); function

    • @cybertech1076
      @cybertech1076 2 года назад

      @@CodeMonkeyUnity thanks for the reply on a video from 2019 your the best

  • @MarkJrLuat
    @MarkJrLuat 4 года назад

    Hey, how do you setup multiple weapons, I alr got one gun (from ur tutorial), but how do you add another without making any errors?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 года назад

      That depends heavily on how you set up your character/animations.
      With the system I used here it's very simple ruclips.net/video/fuGQFdhSPg4/видео.html
      Just swap out the game object for another one

    • @MarkJrLuat
      @MarkJrLuat 4 года назад

      @@CodeMonkeyUnity you mean the "Aim" part? And do I need to make a new script or I can just make a new one (I just started last week xD)

  • @achouriyassin
    @achouriyassin 3 года назад

    how to change the place with joystick in playstation ???

  • @배문성-w4m
    @배문성-w4m 3 года назад

    I am learning well.
    And where can I reference PlayerSwapWeapon.cs?
    and Where download name space Codemonky;

  • @evanraab2104
    @evanraab2104 2 года назад

    Is probably stupid question here but is there a way for me to rename the Testing.cs class? I tried creating a new class and just pasted in the Testing.cs code but it's saying it can't add script to the gameobject (i also asked this yesterday on the wrong video lol - apologies!)

  • @LemuriaGames
    @LemuriaGames 3 года назад

    Wouldn't it be better to define the entire ability as a scriptable object, including its icon and all, rather than having an enum?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 года назад +1

      Yeah this video is pretty old and it's before I really started using Scriptable Objects.
      So if I made this video again nowadays I would probably use Scriptable Objects to hold all that data.

  • @MARUTI96
    @MARUTI96 5 лет назад +1

    Good

  • @sabrango
    @sabrango 5 лет назад

    THX!

  • @djiexn
    @djiexn 3 года назад

    so lets start It should be "very simple" ;)

  • @micaiahstevens8840
    @micaiahstevens8840 5 лет назад +2

    I know it may be asking a LOT; but can you pick better names for your files. Unity DOES not like when you use the same file name. FOR instance, lets say you wanted to use an AWESOME Code Monkey package for Inventory, he sounds familiar, ANYWAYS lets say you implement this and import that package, it breaks the inventory... why?
    When you wrote the Inventory, or pretty much ALL Your packages, you use the same name Testing so when you import, it breaks the sprites from this tutorial and many other packages.
    AbilityBarTesting does not take THAT much more work, vs UIAbilityButtonHotbarActionSystem, OK not as bad, but was close to what you did in this video.
    Anyways, you seem to have a package with MOST of your projects, but seem to break them as you go, for some reason. You can't use past ones and future ones, as it breaks the code.
    ANOTHER idea is to put it under a namespace. BUT thats like WELL advanced.

    • @micaiahstevens8840
      @micaiahstevens8840 5 лет назад

      KEEP up the great work, you seem to be lasting and consistent, SURE you can't fix all your past mistakes, but we can make CodeMonkey the way to go. I am ALMOST going to build a game simple based on ALL the code monkey packages.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 лет назад

      I've thought about that but it would make the videos a tiny bit harder to follow instead of just using "Testing"
      I do come across all those issues every now and then when I update my base project and what I do is import the package into an empty project and rename the files there before copy pasting into my base project.
      One possible solution I have thought about is after the video is recorded rename Testing into Testing_AbilityBar

  • @Ricq777
    @Ricq777 5 лет назад

    Can you make Card game

  • @matthewpatthew1578
    @matthewpatthew1578 5 лет назад +2

    3

  • @epsilon6956
    @epsilon6956 5 лет назад +2

    1