1
\$\begingroup\$

I am using tilemaps to create my own platform game. This is what I had in the first place.

enter image description here

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:

enter image description here

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...

enter image description here

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

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

I find my solution activating an option in the Platform Effector 2D called "Use one way grouping". I have to say that I have no idea what it does, even after reading its documentation, but it seems to have done the trick. If anyone wants to expand on this, and add a more comprehensive answer, I would be happy to know about it.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .