Skip to content

Inventory

Functions

AddWorldVisualizer

 function Inventory.AddWorldVisualizer((Vector3)Starting Pos , (Vector3)endingPos, (optional float)Scale Multiplier, (optional bool)OnlyShowCompleted, (optional bool)ShowAmounts, (optional bool)SpawnGrounded)
Parameter Type 📝 Description
Starting Pos Vector3 The items will show between this local space position (relative to the gameObject's world position) and the ending position. An example would be 0,1,0.
endingPos Vector3 The items will show between this local space position (relative to the gameObject's world position) and the starting position. An example would be 0,1,0.
Scale Multiplier optional float What should the scale of the icons be? 1 is default.
OnlyShowCompleted optional bool If true it won't show items that are still being crafted. Is only useful if you're using this in a crafting machine that uses time for crafting.
ShowAmounts optional bool If set to true it will show a number close to the item's icon representing how many of that item are in the inventory. Defaults to true.
SpawnGrounded optional bool Tries to find the ground position to place the item. Useful if this is being used in a coop and you want the animals to appear in the ground.

Inventory.AddWorldVisualizer

Adds a inventory world visualizer to this inventory. Those are used to display the inventory's content in the world. You can define Starting Pos and Ending Pos in local space and the items will show up between those 2 positions.

Example

inventory.AddWorldVisualizer(Vector3.New(-1,1,0),Vector3.New(1,1,0))
This example adds a world visualizer to an inventory reference.


AddOpenTrigger

 function Inventory.AddOpenTrigger((optional string)Open Text , (optional float)Radius, (optional bool)Use Custom UI Size, (optional float)Inventory Slot Width, (optional float)Inventory Slot Height, (optional float)Inventory Slot Columns)
Parameter Type 📝 Description
Open Text optional string Text that shows when you get close to the trigger
Radius optional float Radius that you can interact with this trigger.
Use Custom UI Size optional bool True if this trigger should use a custom UI size.
Inventory Slot Width optional float Custom UI Width for the inventory slots, defaults to 100
Inventory Slot Height optional float Custom UI Height for the inventory slots, defaults to 100
Inventory Slot Columns optional float Number of columns to display per row if using Custom UI sizes

Inventory.AddOpenTrigger

Adds a trigger to open this inventory.

Example

Inventory.AddOpenTrigger()
This example adds an open trigger to the inventory.


SerializeInventory

 function Inventory.SerializeInventory()

DeserializeInventory

 function Inventory.DeserializeInventory()

Comments