Hello! I’m really stuck on this one. Why not?!?!? What does this mean exactly and why is this happening? Does anybody know? I’ll post a snippet of my code, if there’s something missing or any questions let me know. I don’t usually post questions here because I feel like I can solve most things by myself, but this one I just don’t know.
void PlayFootstepFromRenderer(Renderer Renderer)
{
foreach (TextureSound textureSound in TextureSounds)
{
//change maintex so that it works for other shaders, this is only for pro builder and standart
if (textureSound.Albedo == Renderer.material.GetTexture("_MainTex"))
{
AudioClip clip = GetClipFromTextureSound(textureSound);
audioSource.PlayOneShot(clip);
}
}
}
[System.Serializable]
private class TextureSound
{
public TextureSound Albedo;
public AudioClip[] Clips;
}