The problem was that the sprite was hidden when trying to detect the shape, so it didn't detect it and also I made the square the same as the step size