Тёмный
No video :(

How to Make an Inventory System in Godot - (#1) 

Arkeve
Подписаться 7 тыс.
Просмотров 123 тыс.
50% 1

Опубликовано:

 

24 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 212   
@poemyint4366
@poemyint4366 2 месяца назад
for Godot 4: in inventory script it has to be @onready var inventory_slots in the ready function is inv_slot.gui_input.connect(slot_gui_input.bind(inv_slot)) in the for loop (inventory script) MOUSE_BUTTON_LEFT instead of BUTTON_LEFT instantiate() instead of instance set("theme_override_styles/panel") in the refresh_styles function
@tofidu
@tofidu Месяц назад
THANK YOU
@gumm
@gumm 11 месяцев назад
There is another new difference in the tutorial for Godot4. When you are chaning the hotbar slot background based on whether or not it is occupied: You have to use "set('theme_override_styles/panel', style)" instead of "set('custom_styles/panel', style)"
@lauraqueen7848
@lauraqueen7848 11 месяцев назад
Ma hero
@Mrtargi
@Mrtargi 10 месяцев назад
Man? you just saved me a lot of time.. thnx
@fangzahn
@fangzahn 5 месяцев назад
Thanks!
@lumiscosity
@lumiscosity Год назад
in godot 4, .instance() is now .instantiate()
@theharddrug7566
@theharddrug7566 8 месяцев назад
Dude, with this simple line, you just saved my 3 days search on google
@darkhunter777
@darkhunter777 Месяц назад
write tutorial short =)
@Valgoskast
@Valgoskast 10 дней назад
I am using godot 4 and it says instanciate don't exist, KMP
@DharBluHIZ
@DharBluHIZ 7 дней назад
THX A LOTTT
@54nnu
@54nnu 4 года назад
>mfw an actual inventory tutorial that didn't fry my brain into an itty bitty raisin crisp thank you
@Arkeve
@Arkeve 4 года назад
Haha no problem! Im glad it was helpful :)
@AidenOcelot
@AidenOcelot 3 года назад
I like how in the first half you explained what you were doing and why. And then just gave up and showed finished code
@sworcester1
@sworcester1 Год назад
Help for Godot 4, for those of you in the new engine: inventory slot signal connection: inv_slot.gui_input.connect(slot_gui_input.bind(inv_slot))
@lil-pingos7448
@lil-pingos7448 Год назад
TYSM I ALMOST DELETED ALL MY CODE AND STARTED A NEW TUTORIAL
@Secularis.
@Secularis. Год назад
do you know by any chance how to turn this code into a drag and drop inventory? place items on input.is_action_released I mean
@4dragons632
@4dragons632 Год назад
Thanks for this, I had a feeling it should look vaguely like that but I was fumbling around in the dark for half an hour trying different variations before I spotted this comment and it worked perfectly.
@comradechonky6328
@comradechonky6328 Год назад
Line 9:Identifier "slot_gui_input" not declared in the current scope. It gives me this error
@sworcester1
@sworcester1 Год назад
Not declared in current scope means the variable name is either incorrect, not referenced, or was never created. Check how/where that variable is created :)
@MrMutluOne
@MrMutluOne 4 года назад
I've watched several videos about Inventory sistem in godot, you came with simplest and easiest way, cant wait for ep2
@Arkeve
@Arkeve 4 года назад
Thanks!! That means a lot :)
@ReneSaarsoo
@ReneSaarsoo 2 года назад
Useful tutorial. One important point to note is that the order of calling remove_child() and add_child() matters. You can't have one node shared by several parents. So you need to make sure you always first remove a node from one parent before adding it to another. What I didn't like about the example code here was the direct accessing of the parent Inventory node from Slot nodes (and not only accessing, but modifying its state). It's like spooky action at distance - Inventory asks the Slot to do something, and the Slot ends up modifying the Inventory. I reorganized the code so that pickFromSlot() and putIntoSlot() only add/remove nodes from Slot, while the Inventory takes care of adding/removing its own nodes. I also found it more natural to have the pickFromSlot() return the item it removed.
@brenokaene1087
@brenokaene1087 Год назад
how did you make that?
@chipmunk718
@chipmunk718 Год назад
i refactored the code following this advice and it looks much better now, thanks
@NocturnalMorning
@NocturnalMorning 3 года назад
Great simple tutorial. For anyone following the tutorial. In the putIntoSlot function, don't forget the remove_child line. I spend half of my night figuring out why item.position = Vector2(0,0) was putting my items at the origin after moving them around slots, and that was the missing line. @Arkeve, not going to lie (and I've seen a few other comments about this), I have no idea why some of this works. A little explanation on things like why setting the position to (0,0) works for instance would really help noobs like myself understanding. Having said that, awesome tutorial, thanks for putting in the effort to make this whole series.
@user-gc8ee4kj7z
@user-gc8ee4kj7z 2 года назад
@@kyonas6047 Same lmao, did u fix it?
@benchampagne5266
@benchampagne5266 4 года назад
I don’t think you understand how long I’ve been searching for a tutorial that works EXACTLY like this. But it also explains the mouse filter. Thanks a lot. Can’t wait for the new ones!
@BetaTester704
@BetaTester704 4 года назад
same here, he truely is what we needed and wanted.
@Arkeve
@Arkeve 4 года назад
Glad its helpful!!
@aspiringwebdev1139
@aspiringwebdev1139 4 года назад
Even though the community made tutorials for godot are kind of lacking, it's good to see people starting to make more content. Hope we'll get to the level of unity in terms of content. That would be fantastic.
@ToastedGears
@ToastedGears 4 года назад
This is one of the best tutorials on how to make a basic inventory. Most tutorials stretch over 30 min and if you dont know any coding you dont want to see 30 mins of that
@hunterlepage
@hunterlepage 2 года назад
Actually yes you do want to see 30 minutes of that. You need to learn somehow and if the person is just copy and pasting a bunch of code you're learning nothing whatsoever which defeats the entire purpose
@LoudSodaCaleb
@LoudSodaCaleb 3 года назад
Really good tutorial. But if I could make a sugestion, could you spend more time explaining the functions and their processes a bit more? It would more helpful for beginer/intermediate GDscript users who might not be that familar with what is exactly going on.
@froggyboo684
@froggyboo684 Год назад
Yeeeeeeeeeeah
@thedevine3756
@thedevine3756 4 года назад
Quick, straight to the point, efficient. Good tutorial
@Annmariekahn
@Annmariekahn 8 месяцев назад
for those getting the error: "attempt to call function add_child in base null" make sure you have the correct capitalization for the find_parent("Inventory") part. I named my node 'inventory' with a lowercase I and got the error above because I copied to code from the video with the capital I. as soon as I changed that to a lowercase I in both the pickFromSlot and putIntoSlot it worked and I no longer got that error.
@DinomaxProductions
@DinomaxProductions 6 месяцев назад
Thank you for this comment, I made the exact opposite mistake and couldn't figure out what was wrong
@erengazioglu
@erengazioglu 3 года назад
GREAT tutorial! Tons of tiny revelations that're going to make _anyone's_ life easier. Cheers for good content!
@souvlaki42
@souvlaki42 2 года назад
very good tutorial bro but I have a problem. I'm following this in Godot 3.4 and when I run the project I got the 'Attempt to call function 'add_child' in base 'null instance' on a null instance.' error for inventoryNode. add_child(item) line in slot.gd. Can you help me?
@MarisaClardy
@MarisaClardy 4 года назад
Man, I have a huge amount of code to generate a grid of slots... I really should just be using containers... Nice vid. A lot more simplified than my implementation, which has already had 2 refactors and likely needs yet another after watching this. Hah.
@Arkeve
@Arkeve 4 года назад
Thanks! Well, I spend most my time refactoring old implementations so dont get to down about it. Good luck on your project!
@inhadar11
@inhadar11 Год назад
You are best, my friend. You saved me from write algorithm from scratch. Really good tutorial
@titans7455
@titans7455 4 года назад
Perfect timing to upload this I needed this
@Arkeve
@Arkeve 4 года назад
Glad I could help!
@titans7455
@titans7455 4 года назад
When’s part two
@titans7455
@titans7455 4 года назад
And can u make it so I can pick them up? In part 2
@ILoveWatchingTy
@ILoveWatchingTy 4 года назад
@@titans7455 yea like a adding system
@shrippie-4214
@shrippie-4214 4 месяца назад
Steve Worcester thanks : inv_slot.gui_input.connect(slot_gui_input.bind(inv_slot))
@faithfearless4656
@faithfearless4656 4 года назад
This, worth a subscribe from me. Can't wait for another one.
@Arkeve
@Arkeve 4 года назад
Thank you! Ill try to release the next one as soon as possible
@hiddenascension3624
@hiddenascension3624 2 месяца назад
this code has changed with godot update also from set("custom_styles/panel", default_style) to set("theme_override_styles/panel", default_style)
@mio-xh1ln
@mio-xh1ln Год назад
I've been getting the following problem (Godot Ver. 3.5.1), it says "attempt to call function 'get_node' in base 'null instance' on a null instance". Turns out, I had the GridContainer as a node/ child of TextureRect. So: Inventory>TextureRect>GridContainer (meaning GridContainer is a grandchild of Inventory). It should be Inventory>TextureRect as well as Inventory>GridContainer. This solved the problem for me. I thought I'd mention it, since other people here in the comments seem to have the same problem. Happy coding to yall (:
@BartiqDnB
@BartiqDnB Год назад
So the last part worked for you? Kinda getting stuck in 4.0, tryin got connect the signal in the inventory _ready() function. Would love to know what the solution would be!
@EggMan6162
@EggMan6162 Год назад
​@@BartiqDnBsame problem
@theravenpirate4744
@theravenpirate4744 3 года назад
Wow this has been super helpful with my game. Thank you so much!
@Arkeve
@Arkeve 3 года назад
Glad to hear it!
@theravenpirate4744
@theravenpirate4744 3 года назад
@@Arkeve for some reason I'm finding myself unable to click around the inventory in my game even though it works normally when I open up the inventory scene isolated. Any idea what might be causing the issue?
@qloxhost
@qloxhost 3 года назад
I like the way you make tutorials I would like you to make a full functional game with tutorials :)
@qloxhost
@qloxhost 3 года назад
Is this a yes?
@gilesaspin7083
@gilesaspin7083 3 года назад
Easy to follow and well explained, well done...
@FrancoisSchnell
@FrancoisSchnell 4 года назад
Just discovered the channel with this video, cool! subed and keep it up! :)
@Arkeve
@Arkeve 4 года назад
Thanks for the support! :D
@nathanmasakadza4172
@nathanmasakadza4172 2 года назад
Great tuorial , but the only problem I am having is running get_global_mouse_position(), the engine is saying that the method isn't declared in the current class
@Shadowthevampire
@Shadowthevampire 7 месяцев назад
Id suggest making an update version if this since people have said some things have changed since the update and people also wished for more rxplsnstion for beginners. I like this video do id be happy to see another version of it :)
@Omar-fu4jj
@Omar-fu4jj 3 года назад
i have an issue in line 38 in slots.gd it says : Invalid set index 'position' (on base: 'Nil') with value of type 'Vector2'.
@BrandonTheOverthinker
@BrandonTheOverthinker 28 дней назад
did you find a fix
@maxwamsley
@maxwamsley 3 года назад
Holy sheet how does this guy not have more subs
@mrsentixy8196
@mrsentixy8196 3 года назад
for anyone who is wondering if it works, it works just follow his instructions (Dec 15, 2020)
@anjanavabiswas8835
@anjanavabiswas8835 3 года назад
Okay .. um i was facing an error with the get_global_mouse_position.. thing... so what i did was $"(name of node containing panel)".get_global_mouse_position() Edit: Clicking an item twice ... is breaking the inventory. :( I guess Ishould make another if to fix that?
@kamos2216
@kamos2216 3 года назад
even after like 2 motns i found gold mine real big thanks
@theeternalwanderer3499
@theeternalwanderer3499 Год назад
thx this is a nice and clean tutorial
@bertangokalp9002
@bertangokalp9002 3 года назад
Dude, you are the best in this job
@petbij
@petbij 2 года назад
lovely tutorial. My thanks!
@nieli7695
@nieli7695 2 года назад
hi @Arkeve, in my opinion, this is the best tutorial for beginner that have zero coding knowledge like me.... ty ^^... but i wanna ask u something... how to change mouse button input into touch screen? for examples if we want to export it to android or ios...
@aspect3884
@aspect3884 Год назад
in project settings, input mapping
@dirkkruger1934
@dirkkruger1934 2 года назад
as some one who has absolutely no coding experience. I am going to attempt to modify this so I can use it to code a quest journal instead. LMFAO
@andersstrom740
@andersstrom740 4 года назад
Thanks dude. u r the best!
@Arkeve
@Arkeve 4 года назад
:)
@MrSakfi
@MrSakfi 4 года назад
Nice job... Go on, Bro.
@rchannel1693
@rchannel1693 3 года назад
I love your videos!!! U are da best
@jazzy8391
@jazzy8391 2 года назад
After the ready function towards the end of the video in Inventory.gd, I keep getting an error at for inv_ slot. it says: Attempt to call function 'get_child' in base 'null instance' on a null instance.
@fernandobarbosa25
@fernandobarbosa25 2 года назад
I think it's get_children() instead.
@KanishkaDilshan
@KanishkaDilshan 3 года назад
Looks great!
@Bluelight82
@Bluelight82 3 года назад
Awesome tutorial for Godot! I love it! Is this inventory system safe against duplication of items? And can you expand on it to build a game where machines have an inventory and that one can interact with? Similar to a Furnace in Minecraft? Is it also possible to make a currency system? I such a n00b when it comes to coding! :-P
@TheRealKaiProton
@TheRealKaiProton 7 месяцев назад
3:15 why TextureRect and not Sprite ?
@shrippie-4214
@shrippie-4214 4 месяца назад
I think its because TextureRect can get input
@GrowthforGames
@GrowthforGames 4 года назад
Great video!
@aleksitjvladica.
@aleksitjvladica. 4 года назад
Exactly what I am looking for. I hope this works, other tutorials I checked did not provide the inventory system I would like to have. Edit: [08:10] What is "gui_input"?
@SILVERjavier
@SILVERjavier 2 года назад
gui_input(event: InputEvent)Emitted when the node receives an InputEvent.
@aleksitjvladica.
@aleksitjvladica. 2 года назад
Thank you.
@Thisisdcode
@Thisisdcode 2 месяца назад
so i have this disorder where my code doesen't work when i type it but when copy pasting it it just works and it left me with a wtf moment. any relatables?
@Raformatico
@Raformatico 4 года назад
Great tut, thank you and cheers! 👏 +1 Subs
@Arkeve
@Arkeve 4 года назад
Thank you! Glad you found it helpful :D
@darkhunter777
@darkhunter777 Месяц назад
Стили и закраски ячеек, не обязательно было в туториал запихивать 😁
@user-xs1bv6ns5b
@user-xs1bv6ns5b Месяц назад
Thank a ton!
@jomarllamas7890
@jomarllamas7890 3 года назад
Can this be applied in 3d
@Della_B
@Della_B 2 года назад
I've follow step by step, but i can't swap the items. It won't move 🤔
@Glacialan
@Glacialan 4 года назад
I love this!
@hunterlepage
@hunterlepage 2 года назад
would've been a good tutorial if you didn't copy and paste everything and actually explained them instead
@generic........
@generic........ 2 года назад
Random thing that shouldn't annoy me, but he says "Invent-ory" instead of the more common pronunciation : "Inven-tory" Anyway cool tutorial!
@hamzailer
@hamzailer 4 года назад
omg tysm when is the next one coming out
@Arkeve
@Arkeve 4 года назад
Within the next few days
@hamzailer
@hamzailer 4 года назад
@@Arkeve ill be waiting :D
@Secularis.
@Secularis. Год назад
hello, I've tried re-writing the slot_gui_input function so that pick-up is performed when clicking but put-in-slot functions happen when releasing the input, I just can't make it work for the life of me, it just returns the item to the original slot. Picking up works perfectly fine
@mrnowaatv1205
@mrnowaatv1205 3 года назад
i can't run the code! "Parser Error : The method "get_global_mouse_position" isn't declared in the current class." the code is the same as yours, as i get it into that video
@mrsentixy8196
@mrsentixy8196 3 года назад
same, idk why
@slinky9216
@slinky9216 Год назад
The project does not work it says Line 10:Identifier "File" not declared in the current scope. Line 12:Identifier "File" not declared in the current scope.
@ragnarhagberg6716
@ragnarhagberg6716 3 года назад
This does not work for me when exported to windows. I think my code cannot access the JSON file
@TheTheSusssu
@TheTheSusssu 4 года назад
Thank you for sharing!
@Arkeve
@Arkeve 4 года назад
Anytime ! :D
@Ceisriel
@Ceisriel Год назад
how to resize the images? your code works but the images appear too big not scaled to the grid slots
@jongeorge3358
@jongeorge3358 2 месяца назад
Im having this problem too
@jvstAsYouAre
@jvstAsYouAre 3 года назад
I'm getting an error under the put_into_slot function at item.position = Vector2(0, 0), where it says "Invalid set Index 'position' (on base Nil) with value of type Vector2". When i open the inventory and click on an icon to pick it up my game crashes and I get this error. What could it mean?
@jvstAsYouAre
@jvstAsYouAre 3 года назад
I had literally forgotten if holding item != null under the slot_gui_input funtion. Leaving this here incase someone makes the same mistake
@nieli7695
@nieli7695 2 года назад
u are a life saver... ty so much... T.T
@BronsoloTV
@BronsoloTV 2 года назад
Hey man, I followed the tutorial as closely as I could, but when I load up my inventory screen and click an item, the scene crashes and I get the error “ Attempt to call function ‘add_child” in base ‘null_instance” on a null instance’ “ in my Slot.gd script. I found a loophole by declaring “onready var inventoryNode = find_parent(“Inventory”)” at the top of my Slot.gd script and disabling the middle two lines in “func pickFromSlot” and “func putIntoSlot”, and it doesn’t crash, but I can’t actually drag my items around, only click them into different boxes. Is this a different issue? Any way to fix this? I’m pretty new to Godot so I’m not really sure what I’m doing yet.
@panicasherpanic6776
@panicasherpanic6776 2 года назад
no idea if you figured this out already, but I had the same issue for agggges and it turns out I had just capitalized "Inventory" when my actual node was lowercase ("inventory"). so if i understand correctly, it was calling a node that wasnt there and returning null, hence the "null instance" bit. maybe this helps?
@Stretox
@Stretox 2 года назад
@@panicasherpanic6776 You probably Misspelled Inventory wrong along the way. Also if you already Added your missspelled "Invnetory" Scene into another scene and changed the name afterwards to be correct it doesn't get updated.
@ALEKSONEARTH
@ALEKSONEARTH 3 года назад
im fresh to godot so a noob question - say I had an RTS type of game and wanted to add inventory systems to all the characters, would I attach this node to the nodes for each character? (Ignore that this is probably not performant). Or is this more from the perspective of a World parent node, and one playable character uses it?
@mrapexpredator904
@mrapexpredator904 8 месяцев назад
great tutorial man but im having this issue where the item scene is loading under the slot after i move it with the mouse if i could get a tip
@ILoveWatchingTy
@ILoveWatchingTy 4 года назад
I love the video but have one question Would it be bossible to intergrate like a description system like rarity type
@Arkeve
@Arkeve 4 года назад
Yeah ill go over adding item descriptions as well in future parts. You can see an example in my latest devlog
@ILoveWatchingTy
@ILoveWatchingTy 4 года назад
@@Arkeve Nice man keep it up i see a great future for you :)
@samuelkelly5061
@samuelkelly5061 3 года назад
Hey can someone please help in my inventory script says that it cant call the method "gui_input"
@GorblinRat
@GorblinRat 2 года назад
I am recieving this error, any idea how to solve this? thanks? E 0:00:31.433 emit_signal: Error calling method from signal 'gui_input': 'Node2D(Inventory.gd)::slot_gui_input': Method not found..
@micka394
@micka394 3 года назад
i got the error Nonexistent function instance in base GDscript can anyone pls help
@ClassicMushroom
@ClassicMushroom 3 года назад
You have to show your code if you want help
@micka394
@micka394 3 года назад
@@ClassicMushroom thanks for the help but i deleted the script already
@bnkm07
@bnkm07 2 года назад
before i start watching the whole playlist i wanna ask if this works in 3d?
@dawefuckboi486
@dawefuckboi486 Год назад
Nice vid
@isaac8228
@isaac8228 3 года назад
Everything works well but I couldn't drag the item. I can only swap them around but I can't move them. Does anyone know how to fix this?
@isaac8228
@isaac8228 3 года назад
it was the "func input():" remember to make it "func _input():"
@michaelbennaim9463
@michaelbennaim9463 3 года назад
Hey, I found the tutorial great and very clear, but my program doesn’t work and I can’t for the life of me figure out why. The icons appear correctly but as soon as I click on one of them it disappears, then I can’t do anything anymore. Do you maybe know what’s that related to, thx in advance.
@fye5602
@fye5602 3 года назад
I need a little bit help. If i start my game, the debugger shows me following: Invalid get index 'Slime Potion' (on base: 'Dictionary') on item.gd. Sometimes it's Iron Sword, sometimes Tree Branch. Any ideas? Second Failure: Same as first, but on Slot.gd on the "add_child(item)" line straight after "if randi() % 2 == 0: item = ItemClass.instance()"
@nyctimus6015
@nyctimus6015 4 года назад
hey can you explain a bit what is that you are doing for the default_style: StyleBoxTexture and the empty_style: StyleBoxTexture? cause those are variables you created but you arent assigning stuff to them i havent really seen the colon being used like that with variables before
@Arkeve
@Arkeve 4 года назад
The colon just specifies the type, it isnt necessary. I created the variables but i assign values to them in the ready function.
@JMXBEATS
@JMXBEATS 3 года назад
I had a problem where in pickFromSlot it said I was attempting to add a child in a null instance on a null instance
@millioncats5790
@millioncats5790 3 года назад
I have the same problem, I think it's having trouble finding the "Inventory" node but showing it the path didn't work for me
@Yoni123
@Yoni123 3 года назад
How about using a gsmepad instead of a mouse?
@samil679
@samil679 3 года назад
Amazing but i would like to ask that how can i add more than 2 items in 6 slots.I hope u will help me.
@Paulos777
@Paulos777 3 года назад
7:30 how did we come up with item = new_item ? when I type that in, I get and error (The identifier "new_item isn't declared in the current scope. Anyone else with that problem?
@lightbreathermusic
@lightbreathermusic 3 года назад
the function must be defined as func putIntoSlot(new_item): what this does is it defines a function and a local variable
@ClassicMushroom
@ClassicMushroom 3 года назад
Hey so I am using your tutorial and everything is working except for the fact that my sprites are huge in the inventory, blocking it up entirely.
@jnju5112
@jnju5112 3 года назад
This is a late reply but try adjusting the scale setting of the sprites. I think it has to do with your sprites being hypothetically 64x64 while the inventory slot is 32x32
@ArtembAartemb
@ArtembAartemb 3 года назад
Hi, great tutorial, thank you! I was trying to make it similar to yours, but so that you don't click to pickup then click to drop, but you drag and drop. The problem I found is that the mouse release event triggers on the same panel on which you pressed it, but not the panel you have your mouse on when releasing, Bloody annoying. Does anyone know of any workaround for that? Thanks
@gersongerson2481
@gersongerson2481 3 года назад
just when you release the mouse a InputEventMouseMotion event appear (for the other panel), so you should can check if the last event was a left click release, there is my code: var last_event : InputEvent = null var last_slot : SLOT_CLASS = null func slot_gui_input(event : InputEvent, slot : SLOT_CLASS): if event is InputEventMouseButton: if event.button_index == BUTTON_LEFT && event.pressed == true: if holding_item != null: #On Put OnPutItem(event, slot) elif slot.item: # On Pick OnPickItem(slot) last_event = event last_slot = slot # On release elif event is InputEventMouseMotion: if last_event != null: if last_event.button_index == BUTTON_LEFT && last_event.pressed == false: if holding_item != null: OnPutItem(event, slot, last_slot) func OnPutItem(event : InputEvent, slot : SLOT_CLASS, slot2 : SLOT_CLASS = null): if !slot.item: #Put on empty slot slot.PutIntoSlot(holding_item) elif slot.item and slot2 != null: # Swap items slots var temp_item = slot.item slot.RemoveItem() slot.PutIntoSlot(holding_item) slot2.PutIntoSlot(temp_item) #slot2 is a empty slot before OnPickItem holding_item = null
@agriasoaks6721
@agriasoaks6721 2 года назад
@@gersongerson2481 what is this "item" in the code of the inventory?
@gersongerson2481
@gersongerson2481 2 года назад
@@agriasoaks6721 The item is the object that slot hold.
@agriasoaks6721
@agriasoaks6721 2 года назад
@@gersongerson2481 In my design, I combine the panel(slot) and the texture rect(item). In result, I can't move the item. How can we fix it?
@gersongerson2481
@gersongerson2481 2 года назад
​@@agriasoaks6721 the item should be a Node2D (not a texture rect) because it has a global_position property. Try to do exactly the tutorial so that you understand the solution.
@connorjade5460
@connorjade5460 5 месяцев назад
when will u update the videos for godot 4??
@solicity1785
@solicity1785 4 года назад
great tutorial really easy to get along to but i feel like its kinda inefficient to preload the item can adding a button to the item scene and set one var into an array of the panels and for loop checking of all of them is null then if it isnt then when on click event happens you just code in the variable to set the preload into the item that was clicked on or is this less efficient and impossible anywaays great vid hope you make more
@Arkeve
@Arkeve 4 года назад
Yeah you maybe right, I wasn't focusing too much on performance with these tutorials, you can definitely try to modify it to how you like for a better performing system!
@solicity1785
@solicity1785 4 года назад
@@Arkeve nah im probably not right as i tried it and not 1 bit of my idea works on godot atleast but great videos man hope you grow more subs!!
@n3rf591
@n3rf591 3 года назад
When I put in the code I can get the randomized items but it never lets me move them I keep checking I tried copying and pasting from the one thats in the zip file but it gives me an error and when I type it out it doesn't even do anything and gives me errors I dont know how to fix
@shrippie-4214
@shrippie-4214 2 года назад
same you figure it out yet i tried printing something when i click the mouse button and it doesn't even sense the input
@Della_B
@Della_B 2 года назад
Same, it happen to me too. I've try to add and set an Input Map "BUTTON_LEFT", yet it still didn't work :/
@geckokun2805
@geckokun2805 3 года назад
Cool!
@youbadassXneb
@youbadassXneb 3 года назад
i have exactly copied your "Item" code and i get this error Script inherits from native type 'Node2D', so it can't be instanced in object of type: 'Panel' why is this? EDIT: The erro was because i am an idiot. It was because i chose the "Item" script for my panels.
@dipievil
@dipievil 3 года назад
Dude.... You just saved aonther idiot here! Thanks
@Yukaraoke
@Yukaraoke 3 года назад
Iv been working for days on my inventory in unity. I also have a way to save my player data. Was wondering if it would be worth it or if its easier to transfer my progress to godot with all these available tutorials now.
@Arkeve
@Arkeve 3 года назад
I haven't tried Unity so I can't give you any sound advice. But maybe try out Godot and see how you like it first before switching.
@Yukaraoke
@Yukaraoke 3 года назад
I've started using Godot now and I'm following your tutorials. Thanks a lot for this. You deserve all support 💕
@Yukaraoke
@Yukaraoke 3 года назад
I've started using Godot now and I'm following your tutorials. Thanks a lot for this. You deserve all support 💕
@faridrifai2166
@faridrifai2166 4 года назад
Thanks
@ernst1183
@ernst1183 2 года назад
Hi! I'm a beginner and I'm studying these scripts to improve my "syntax". There's a particular line i I'm struggling with. It's the 15th line in the inventory.gd script: If !slot.item: I didn't know you could use "!" in that way. So far I had only used it in the "!=" expression. Could anyone explain to me what is that line really "saying" and where could i find more information about that usage of "!"? I've tried with the official documentation with no luck.
@v84l42
@v84l42 2 года назад
if !slot.item: means if slot item is false if (slot.item): means if slot item is true
@ernst1183
@ernst1183 2 года назад
@@v84l42 Ok! Thanks for your answer!
@agriasoaks6721
@agriasoaks6721 2 года назад
Sir, why can't I move my item? Do you know what the problem might be?
@Sheol_Society
@Sheol_Society 2 месяца назад
In the Inventory script change line 27 & 31 to holding_item.global_position = event.global_position this worked for me.
@hollisneufeld1216
@hollisneufeld1216 2 года назад
nice video but, idk, mine doesnt work
@potat1658
@potat1658 3 года назад
Is there a difference between a node and a node 2d?
@Arkeve
@Arkeve 3 года назад
Node2D is usually used for 2d games and Node is used for 3D
@noahgranger6749
@noahgranger6749 3 года назад
Will this tutorial still work in 3d?
@cmds.learning7426
@cmds.learning7426 4 года назад
cool
@son9012
@son9012 9 месяцев назад
child of a slot... sounds sus hehe
@definitelymdt
@definitelymdt 2 года назад
Does this work for Android too?