It will just go through

I want the cat when hit the apple, we will get 5 points. And when the apple hit the wall, it will go to a random position. It worked until i want to create a banana with the same mechanics as the apple but it won’t work. It will only hit the cat and will go through the wall. How to fix this?