Eusong Posted September 8, 2017 Share Posted September 8, 2017 (edited) Basically I'm trying to make a custom armor but whenever it's equipped and the player is facing forward, the image for when it's on the ground is visible, attached to the player's behind. Here's the code for the armor piece. As far as I can tell, there's no reason it should be doing this. Spoiler local assets = { Asset("ANIM", "anim/vaultsuit.zip"), Asset("ATLAS", "images/inventoryimages/vaultsuit.xml"), Asset("IMAGE", "images/inventoryimages/vaultsuit.tex"), } local function onequip(inst, owner) owner.AnimState:OverrideSymbol("swap_body", "vaultsuit", "swap_body") owner:AddTag("radresistant") inst.components.fueled:StartConsuming() end local function onunequip(inst, owner) owner.AnimState:ClearOverrideSymbol("swap_body") owner:RemoveTag("radresistant") inst.components.fueled:StopConsuming() end local function onperish(inst) inst:Remove() end local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.AnimState:SetBank("vaultsuit_ground") inst.AnimState:SetBuild("vaultsuit") inst.AnimState:PlayAnimation("anim") inst:AddTag("vaultsuit") inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end inst:AddComponent("inspectable") inst:AddComponent("inventoryitem") inst.components.inventoryitem.atlasname = "images/inventoryimages/vaultsuit.xml" inst:AddComponent("fueled") inst.components.fueled.fueltype = "USAGE" inst.components.fueled:InitializeFuelLevel(6*60) inst.components.fueled:SetDepletedFn(onperish) inst:AddComponent("equippable") inst.components.equippable.equipslot = EQUIPSLOTS.BODY inst.components.equippable:SetOnEquip(onequip) inst.components.equippable:SetOnUnequip(onunequip) MakeHauntableLaunch(inst) return inst end return Prefab("vaultsuit", fn, assets) Edited September 8, 2017 by Eusong Link to comment Share on other sites More sharing options...
Eusong Posted September 10, 2017 Author Share Posted September 10, 2017 Anyone? I'm really stumped as to how to fix this. Link to comment Share on other sites More sharing options...
Lumina Posted September 10, 2017 Share Posted September 10, 2017 I don't think the problem is with the code (or with the code only), maybe with the spriter project ? Could you post it, and also post an image of the problem so it's easier to see what is wrong ? Link to comment Share on other sites More sharing options...
Eusong Posted September 10, 2017 Author Share Posted September 10, 2017 http://prntscr.com/gjk09u ^That shows the bug in action. exported.zip Link to comment Share on other sites More sharing options...
Eusong Posted September 14, 2017 Author Share Posted September 14, 2017 Part of me wonders if it's a problem with the Spriter project, but Idk how to tell if that's it. Any help? :c Link to comment Share on other sites More sharing options...
Ryuushu Posted September 15, 2017 Share Posted September 15, 2017 @Eusong I ran into that problem a few days ago, eventually started using it as a feature. Move swap_body-13 outside the swap folder and rename it vaultsuit or something else before using it in an anim. Link to comment Share on other sites More sharing options...
Eusong Posted September 17, 2017 Author Share Posted September 17, 2017 On 9/15/2017 at 8:05 AM, Ryuushu said: @Eusong I ran into that problem a few days ago, eventually started using it as a feature. Move swap_body-13 outside the swap folder and rename it vaultsuit or something else before using it in an anim. Oooh, okay. Thanks! Hopefully this should fix it. Link to comment 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