Sorry for the late reply. I was problem solving this with ChatGPT for ages. It did not work.
The problem, I think, is that there are multiple logs and bridges constantly overlapping eachother as well as enemies using the same platforms. It really complicates things.