No video

Ability Bar in Unity (Swap Weapons/Items)

  Рет қаралды 32,360

Code Monkey

Code Monkey

Күн бұрын

✅ Get the Project files and Utilities at unitycodemonke...
Here's a great Hotkey Bar where you can Activate Abilities and Drag Drop them into a new position.
How to Drag UI Windows and Send to Top in Unity
• How to Drag UI Windows...
Simple Drag Drop
• How to Drag UI Windows...
Simple Inventory System in Unity (Store, Use, Stack and Drop Items)
• Simple Inventory Syste...
If you have any questions post them in the comments and I'll do my best to answer them.
🔔 Subscribe for more Unity Tutorials / @codemonkeyunity
See you next time!
🤖 Join the Community Discord / discord
📦 Grab the game bundle at unitycodemonke...
📝 Get the Code Monkey Utilities at unitycodemonke...
#unitytutorial #unity3d #unity2d
--------------------------------------------------------------------
Hello and welcome, I am your Code Monkey and here you will learn everything about Game Development in Unity 2D using C#.
I've been developing games for several years with 7 published games on Steam and now I'm sharing my knowledge to help you on your own game development journey.
You can see my games at www.endlessloopstudios.com
--------------------------------------------------------------------
- Website: unitycodemonke...
- Twitter: / unitycodemonkey
- Facebook: / unitycodemonkey

Пікірлер: 49
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
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 4 жыл бұрын
Just started my game development journey. I appreciate you making these videos to help guide me along 👾
@speedrob
@speedrob 4 жыл бұрын
Very nice, another top quality tutorial.
@Andrew90046zero
@Andrew90046zero 4 жыл бұрын
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 4 жыл бұрын
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 4 жыл бұрын
awesome tutorial
@neozoid7009
@neozoid7009 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.
@あれくす
@あれくす 4 жыл бұрын
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?
@brianwaltse281
@brianwaltse281 3 жыл бұрын
Great work! Thanks for the info!
@457Deniz457
@457Deniz457 4 жыл бұрын
AS ALWAYS ! Thanks :)
@ikiller_eg
@ikiller_eg 4 жыл бұрын
You are the best 😘 thank you
@Bruno-mq5ss
@Bruno-mq5ss 4 жыл бұрын
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 жыл бұрын
You need to combine the hotkey bar with some sort of inventory system kzfaq.info/get/bejne/aL2edLKHnNSsh2Q.html kzfaq.info/get/bejne/n9lxoNJ-mLi0dX0.html
@benimaru5444
@benimaru5444 4 жыл бұрын
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 4 жыл бұрын
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 4 жыл бұрын
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 4 жыл бұрын
@@casualgermans I said Udemy because I dont know any other website with content like that
@Milanyd_
@Milanyd_ 3 жыл бұрын
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();
@user-yg9rq6xn3o
@user-yg9rq6xn3o 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
@achouriyassin
@achouriyassin 3 жыл бұрын
how to change the place with joystick in playstation ???
@micaiahstevens8840
@micaiahstevens8840 4 жыл бұрын
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 4 жыл бұрын
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 4 жыл бұрын
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
@cybertech1076
@cybertech1076 Жыл бұрын
Hey, How Would You Implement This With Your Inventory System You Made Previously?
@CodeMonkeyUnity
@CodeMonkeyUnity Жыл бұрын
For the hotkeyability callback you would just hook that onto the item.Use(); function
@cybertech1076
@cybertech1076 Жыл бұрын
@@CodeMonkeyUnity thanks for the reply on a video from 2019 your the best
@MarkJrLuat
@MarkJrLuat 3 жыл бұрын
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 3 жыл бұрын
That depends heavily on how you set up your character/animations. With the system I used here it's very simple kzfaq.info/get/bejne/nNt3hKmVzbm0l2g.html Just swap out the game object for another one
@MarkJrLuat
@MarkJrLuat 3 жыл бұрын
@@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)
@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 жыл бұрын
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.
@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!)
@CodeMonkeyUnity
@CodeMonkeyUnity 2 жыл бұрын
Does the class extend MonoBehaviour?
@Zereze
@Zereze 4 жыл бұрын
1:59 what are the codes you didnt show us? because my code doesnt work without them
@CodeMonkeyUnity
@CodeMonkeyUnity 4 жыл бұрын
The implementation of those functions is irrelevant to the Ability Bar. It depends heavily on how you set up the rest of your game like how your animation system works. Your Ability Bar shouldn't care about how its implemented.
@Zereze
@Zereze 4 жыл бұрын
@@CodeMonkeyUnity ok thx
@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!
@user-ig6tr2en3s
@user-ig6tr2en3s 3 жыл бұрын
I am learning well. And where can I reference PlayerSwapWeapon.cs? and Where download name space Codemonky;
@sabrango
@sabrango 4 жыл бұрын
THX!
@djiexn
@djiexn 3 жыл бұрын
so lets start It should be "very simple" ;)
@user-yg9rq6xn3o
@user-yg9rq6xn3o 3 жыл бұрын
what script editor do you use?
@CodeMonkeyUnity
@CodeMonkeyUnity 3 жыл бұрын
Visual Studio Community
@MARUTI96
@MARUTI96 4 жыл бұрын
Good
@Ricq777
@Ricq777 4 жыл бұрын
Can you make Card game
@matthewpatthew1578
@matthewpatthew1578 4 жыл бұрын
3
@Zereze
@Zereze 4 жыл бұрын
?
@epsilon6956
@epsilon6956 4 жыл бұрын
1
@hamahed1778
@hamahed1778 3 жыл бұрын
hahahahah
I tried Cuphead’s hardest speedrun
29:45
EazySpeezy
Рет қаралды 135 М.
How to Equip Weapons and Items in Unity (Drag Drop, Inventory)
18:06
КТО ЛЮБИТ ГРИБЫ?? #shorts
00:24
Паша Осадчий
Рет қаралды 3,6 МЛН
Schoolboy Runaway в реальной жизни🤣@onLI_gAmeS
00:31
МишАня
Рет қаралды 3,9 МЛН
PEDRO PEDRO INSIDEOUT
00:10
MOOMOO STUDIO [무무 스튜디오]
Рет қаралды 16 МЛН
Steam EXPERT teaches you Game Marketing for SUCCESS!
52:22
Code Monkey
Рет қаралды 59 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 706 М.
A new way to generate worlds (stitched WFC)
10:51
Watt Designs
Рет қаралды 525 М.
Chess, but Pieces EVOLVE
8:48
ChessTraps
Рет қаралды 51 М.
20 Advanced Coding Tips For Big Unity Projects
22:23
Tesseract
Рет қаралды 179 М.
The Trick I Used to Make Combat Fun! | Devlog
8:12
Game Endeavor
Рет қаралды 1,6 МЛН
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4 МЛН
Should you use Assets? Is it cheating? Asset flip?
7:26
Code Monkey
Рет қаралды 54 М.