RailgunZx
Terrarian
I have a custom sound that I plan to eventually use with a custom projectile but right now I can't even figure out how to get the sound to play when assigned to a sword swing.
Here is the code for my sound:
And here is the code used in the sword item:
Can someone tell me why the sound doesn't play?
Thanks
Here is the code for my sound:
Code:
using Microsoft.Xna.Framework.Audio;
using Terraria.ModLoader;
using Terraria;
namespace hyperfrostw.Sounds.Item
{
class masterswordbeamsound : ModSound
{
public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType Type)
{
soundInstance = sound.CreateInstance();
soundInstance.Volume = volume * .5f;
soundInstance.Pan = pan;
soundInstance.Pitch = -1.0f;
return soundInstance;
}
}
}
And here is the code used in the sword item:
Code:
item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/masterswordbeamsound");
Can someone tell me why the sound doesn't play?
Thanks