Operator "==" cannot be applied to operands of type 'Footsteps.TextureSound' and 'Texture'

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;
    }

Because a TextureSound is not a Texture2D

1 Like

Slow down, the answer is very simple: apples and oranges.

Some help to fix “Cannot implicitly convert type ‘Xxxxx’ into ‘Yyyyy’:”

http://plbm.com/?p=263

2 Likes

Thank you for your answer! It was a pretty obvious answer now that I figured it out, turns out Texture autocorrected to TextureSound. I’ve now got some other issues that I may or may not post about lol.