Use Grid:SetVisibility()
instead, this will also change the items.
Edit: Nevermind. I figured it out. There isnt a āAutocompleteā so i thought i was doing it on the wrong thing.
My bad.
Sorry to add more errors, but when you try and move an item thatās too big for a grid into it, the game freaks out.
Yes, this is a bug! Please report it on the GitHub issues page so that I and others can track it easily. Thanks!
Ok!
Iāve tried to fix this with ChatGPT many times, but I guess this bug is a little more complicated than that . In the mean time Iāll try and find a temporary fix for myself, but let me know when itās fixed!
I might use that for my game, I like thatā¦
Is there a Roblox model for this?
Is there a way for new items to find an available spot instead of throwing error
Iām talking about this portion of the code
Yes, just use the Grid:GetNextFreePositionForItem(item)
method. It returns a space where the item doesnāt collide and nil
when there is no free space for the item!
Hey, i keep on running into this bug which only happens with certain rotations (?)
The objects are created while the screen gui is disabled so its possibly messing with the absolute values. Dragging the objects fixes their positions.
Was just wondering if you have any proper solution to this as i dont necessarily feel like coming up with a bandaid one, thanks!
And, amazing resource, ofcourse!
Not really sure why this happens, but try disabling a frame instead of the screen gui. I will rework this library a bit soon-ish for v0.3 so donāt expect a fix too soon. And if you have time, please post this as an issue on the issues page!
Is there a cleanup function to remove an entire Grid with items?
Hereās an Image of the Item Iām trying to cleanup once the player is done viewing it:
ClearItems is throwing this error
I think itās conflicting with Trove when it attempts to cleanup after running ClearItems?
If I run LastContainer:ClearItems()
instead of LastContainer:ClearItems(true)
I donāt get this error. Essentially Trove clears the item for me and it avoids that conflict.
Really decent resource, covers about everything you need to make a survival type of inventory. Could also create your own crafting system with it. Thanks a lot for making this.
Hey! This is super cool, But just wondering how does the meta Data work? And how can I access it? Because currently I havent found any documentation on how to get data from it.
Example:
local InventoryGrid = GridPack.createGrid({
Parent = GUI, -- Parent of the grid container.
Visible = true, -- If the grid is visible, changes the containers visible property. Also disables item interaction on all items inside. BY DEFAULT THIS IS SET TO FALSE to prevent the inventory being shown when first creating the Grid.
Assets = {
Slot = nil, -- Add your own CanvasGroup here to customize the slots in the grid.
},
GridSize = Vector2.new(10, 20), -- How many slots the grid has on the X and Y axes.
SlotAspectRatio = 1, -- Aspect ratio of one slot in the grid, helps with different resolutions if you're using scale instead of offset.
AnchorPoint = InventoryFrame.AnchorPoint, -- Anchor point of the grid container.
Position = InventoryFrame.Position, -- Position of the grid container.
Size = InventoryFrame.Size, -- Size of the grid container.
Metadata = {
Type = "Inventory"
},
})
print(InventoryGrid.Metadata.Type)
Itās basically a custom table
Ahh, Alright thank you so much.
is there a way to get the current item manager of the item? because i tried these but it wont give me the current one local currentItemManager = self.HoveringItemManager or self.ItemManager