Sorry for the dumb question...I'm very new to coding. I'm having an issue with my modded sword, originally the problem was that it was way too large, but I fixed that by changing the scale property. However, now it has another issue. The sword is the right size now, however there are two of them, one of each side of the player, and held very far away from the player's hand. Both the swords seem to have separate functional hitboxes.
I've tried using this statement here and trying out all sorts of different combinations of numbers within the parentheses, but no matter what I do it doesn't change anything at all:
public override Vector2? HoldoutOffset()
{
return new Vector2(0, 0);
}
Does anyone know how to fix this? I have a video of the sword in action and I'll paste my current code for reference. The sprite I'm using will be attached as well if that's useful.
Video:
sworderror.mp4
My code:
using Terraria;
using Microsoft.Xna.Framework;
using Terraria.ID;
using Terraria.ModLoader;
namespace ZephyrMod.Items
{
public class KrakenSplitter : ModItem
{
public override void SetStaticDefaults()
{
// DisplayName.SetDefault("KrakenSplitter"); // By default, capitalization in classnames will add spaces to the display name. You can customize the display name here by uncommenting this line.
Tooltip.SetDefault("Summons homing water shards from the sky");
}
public override void SetDefaults()
{
item.damage = 45;
item.melee = true;
item.width = 4;
item.height = 4;
item.useTime = 20;
item.useAnimation = 20;
item.useStyle = 1;
item.knockBack = 6;
item.value = 10000;
item.rare = 2;
item.scale = 0.1f;
item.UseSound = SoundID.Item1;
item.autoReuse = true;
}
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(BuffID.OnFire, 180);
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(mod.GetItem("HydraflameBar"), 10);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
Edit: Solved, the problem was I needed to resize the png to be much smaller