I am using tilemaps to create my own platform game. This is what I had in the first place.
This was working fine in first place, but is an issue. Sometimes, the enemies get stuck while running along the platforms. This was probably due to a similar issue that I had, when the player was getting stuck on the walls. It was solved by adding a composite collider. So I did the same to solve this problem. With the composite, it was looking like this:
This solved the issue too. But now comes the catch. Those elements are also platforms, meaning that I have to add a platform effector. And while this works, there is a small edge case...
If I am in a height where I do not reach the top of the platform, but can reach the bottom part, somehow it can stand on it. This was not happening before using the composite collider 2D.
Why is this happening? How can avoid this issue?
I am using Unity 2019.3.9f1