Yes . i use tmodloader.You want to spawn dust on the player body, or on the projectile ?
And you're using tmodloader, right ?
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Vector2 muzzleOffset = Vector2.Normalize(new Vector2(speedX, speedY)) * 64f;
if (Collision.CanHit(position, 0, 0, position + muzzleOffset, 0, 0))
position += muzzleOffset;
int dustQuantity = 5; // How many particles do you want ?
for(int i = 0 ; i < dustQuantity ; i ++)
{
Vector2 dustOffset = Vector2.Normalize(new Vector2(speedX, speedY)) * 32f;
int dust = Dust.NewDust(player.position + dustOffset, item.width, item.height, 6); // Create the dust, "6" is the dust type (fire, in that case).
Main.dust[dust].noGravity = true; // Is the dust affected by gravity ?
Main.dust[dust].velocity *= 1f; // Change the dust velocity.
Main.dust[dust].scale = 1.5f; // Change the dust size.
}
return true; // Do you want the weapon to shoot the initial projectile ?
}
Wow thank you very much !!You can use this, in the ITEM.cs file of your weapon.
C#:public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Vector2 muzzleOffset = Vector2.Normalize(new Vector2(speedX, speedY)) * 64f; if (Collision.CanHit(position, 0, 0, position + muzzleOffset, 0, 0)) position += muzzleOffset; int dustQuantity = 5; // How many particles do you want ? for(int i = 0 ; i < dustQuantity ; i ++) { Vector2 dustOffset = Vector2.Normalize(new Vector2(speedX, speedY)) * 32f; int dust = Dust.NewDust(player.position + dustOffset, item.width, item.height, 6); // Create the dust, "6" is the dust type (fire, in that case). Main.dust[dust].noGravity = true; // Is the dust affected by gravity ? Main.dust[dust].velocity *= 1f; // Change the dust velocity. Main.dust[dust].scale = 1.5f; // Change the dust size. } return true; // Do you want the weapon to shoot the initial projectile ? }
It will spawn dust on the weapon when used, feel free to change it however you need to.