Inutile Vie Posted September 1, 2019 Share Posted September 1, 2019 (edited) Hello! Theres my problem: i just dont know now to rise item on chracter's hand. I drew a sword for my character, but if i'll try to make texture bigger \because I want the blade at head level\ character it does not rise higher its hurts, i think! Sword's image is 200x200 Theres sword.lua: Quote local assets= { Asset("ANIM", "anim/sword.zip"), Asset("ANIM", "anim/swap_sword.zip"), Asset("ATLAS", "images/inventoryimages/sword.xml"), Asset("IMAGE", "images/inventoryimages/sword.tex"), } local prefabs = { } local function fn(colour) local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_sword", "sword") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end local function OnUnequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") end local inst = CreateEntity() local trans = inst.entity:AddTransform() local anim = inst.entity:AddAnimState() if not TheWorld.ismastersim then return inst end inst:AddComponent("weapon") inst.components.weapon:SetDamage(40) inst:AddComponent("inspectable") anim:SetBank("sword") anim:SetBuild("sword") anim:PlayAnimation("idle") inst:AddComponent("inventoryitem") inst.components.inventoryitem.imagename = "sword" inst.components.inventoryitem.atlasname = "images/inventoryimages/sword.xml" inst:AddComponent("equippable") inst.components.equippable:SetOnEquip( OnEquip ) inst.components.equippable:SetOnUnequip( OnUnequip ) end return Prefab("common/inventory/sword", fn, assets, prefabs) I will be glad to any answers! Edited September 1, 2019 by Inutile Vie Link to comment Share on other sites More sharing options...
Thomas Die Posted September 1, 2019 Share Posted September 1, 2019 you can try to change the base image up so it fits i would probably make the canvas larger then move the sword Link to comment Share on other sites More sharing options...
IronHunter Posted September 1, 2019 Share Posted September 1, 2019 In spriter change the pivot position to the handle. You need to change it in folder symbol. You can either do this via text editor to change the folder symbol pivot or in spritet when you click on the texture in the folder you can change the default pivot. 1 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