Help with weapon holdstyle

Zandor

Terrarian
Hello! Im trying to make a melee weapon and the code is not having problems. But, when I get ingame it appears like that when I use:
1664638547004.png

I'd like it to use holding on the hand, so I tried using to use HoldStyle() to try moving it as it is useStyle=1, but it didn't work.
Is there a way to solve this, and someone can explain why it is like that?
 
That's just a weird thing that happens due to sprite sizes, you can try to mess with this until it looks right, I believe it works on melee weapons as well.
C#:
        public override Vector2? HoldoutOffset()
        {
            return new Vector2(-1, 1);
        }
 
That's just a weird thing that happens due to sprite sizes, you can try to mess with this until it looks right, I believe it works on melee weapons as well.
C#:
        public override Vector2? HoldoutOffset()
        {
            return new Vector2(-1, 1);
        }
I tried it again, but I think that the HoldoutOffSet() is only used for useStyle=5. As mine is a melee weapon (useStyle=1) it won't work :(
 
I already solved it :)
I used some codes in UseStyle and changed some values to make the weapon stay on the hand, just like that:
C#:
public override void UseStyle(Player player, Rectangle Dartonk)
        {
            player.itemLocation.Y = player.Center.Y + 5;
            player.itemLocation.X = player.Center.X -5 * player.direction;
        }
 
Back
Top Bottom