DarkM Posted August 23, 2025 Share Posted August 23, 2025 I'm creating a new prefab, but it uses the hardwood hat appearance, but I have a problem, when I drop the item on the ground, it becomes invisible. I imagine the problem could be SetBank and SetBuild, but I've already tested all the combinations with hat_woodcarved, woodcarvedhat and just woodcarved, nothing changed. local assets = { Asset("ANIM", "anim/hat_woodcarved.zip"), } local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_hat", "hat_woodcarved", "swap_hat") owner.AnimState:Show("HAT") owner.AnimState:Show("HAIR_HAT") owner.AnimState:Hide("HAIR_NOHAT") owner.AnimState:Hide("HAIR") if owner:HasTag("player") then owner.AnimState:Hide("HEAD") owner.AnimState:Show("HEAD_HAT") end end local function OnUnequip(inst, owner) owner.AnimState:Hide("HAT") owner.AnimState:Hide("HAIR_HAT") owner.AnimState:Show("HAIR_NOHAT") owner.AnimState:Show("HAIR") if owner:HasTag("player") then owner.AnimState:Show("HEAD") owner.AnimState:Hide("HEAD_HAT") end end local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst:AddTag("hat") inst:AddTag("wood") inst.AnimState:SetBank("hat_woodcarved") inst.AnimState:SetBuild("hat_woodcarved") inst.AnimState:PlayAnimation("idle") inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end MakeHauntableLaunch(inst) inst:AddComponent("inspectable") inst:AddComponent("inventoryitem") inst.components.inventoryitem.atlasname = "images/inventoryimages3.xml" inst.components.inventoryitem.imagename = "woodcarvedhat" inst:AddComponent("tradable") inst:AddComponent("armor") inst.components.armor:InitCondition(TUNING.ARMOR_WOODCARVED_HAT, TUNING.ARMORGRASS_ABSORPTION) inst.components.armor:AddWeakness("beaver", TUNING.BEAVER_WOOD_DAMAGE) inst:AddComponent("fuel") inst.components.fuel.fuelvalue = TUNING.LARGE_FUEL MakeSmallBurnable(inst, TUNING.SMALL_BURNTIME) MakeSmallPropagator(inst) inst:AddComponent("equippable") inst.components.equippable.equipslot = EQUIPSLOTS.HEAD inst.components.equippable:SetOnEquip(OnEquip) inst.components.equippable:SetOnUnequip(OnUnequip) return inst end return Prefab("common/inventory/carvedhat", fn, assets) Link to comment https://forums.kleientertainment.com/forums/topic/167683-item-becoming-invisible-when-dropped-on-the-ground/ Share on other sites More sharing options...
FerniFrenito Posted August 24, 2025 Share Posted August 24, 2025 If after throwing it you can still pick up the object the yeah, maybe the bank. I'll tell you how (I think) it works. On your Spriter it should look like this: then make sure that when you start your don't starve (and don't have the "ANIM" folder) it does this with your scml name file: Next, check that there's a .zip file in the same folder as your scml file. Open it, and it should look like this: Then in the code put the name that appears as "root" in the animation.xml file inst.AnimState:SetBank("hunterhat_BANK") inst.AnimState:PlayAnimation("idle") and in the game: 1 Link to comment https://forums.kleientertainment.com/forums/topic/167683-item-becoming-invisible-when-dropped-on-the-ground/#findComment-1832739 Share on other sites More sharing options...
DarkM Posted September 2, 2025 Author Share Posted September 2, 2025 Thanks for the answer ❤️ I finally managed to solve it and forgot to come back here, but your explanation was very well done, congratulations! 👏👏👏 It will definitely help a lot of people 😄 1 Link to comment https://forums.kleientertainment.com/forums/topic/167683-item-becoming-invisible-when-dropped-on-the-ground/#findComment-1833710 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now