Jump to content

Recommended Posts

I want to implement the effect of picking up the items (seeds) inside the backpack in the script, just like clicking with the left mouse button, and placing them under the mouse cursor, but I don't know which method to use. If I implement。

local function TakeItemFromInventory(inst, item)
    if inst.components.inventory ~= nil and inst.components.inventory:GetActiveItem() == nil then
        inst.components.inventory:TakeActiveItemFromAllOfSlot(item)
        inst.components.inventory:SetActiveItem(item)
    end
end

I tried this, but it didn't work。

I hope someone can help me, thanks

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...