Originally, in this 2D platformer, I have two separate entities for walls and floors. The floors are set to play a sound, while the walls don't. However, this has proven to generate quite a few problems. For example, when running into a wall, the game seems to detect that the character has collided with the floor again, and plays the sound each time I run into the wall. Confusingly, this doesn't happen on the wall opposite, which seems to work perfectly in terms of making the sound when it should.
Is there a way to fix and optimize this, or maybe even a completely different way of implementing this feature?
All help appreciated.