Hello,
We are experiencing a bug in our game and we’re hoping the dev community to help us with it. In this case, our platforming game needs one-way platforms. Unity has them integrated in the engine, so that’s fine. But
when our character is about to get to the top of them, with his collider already overlapping the one that acts as the platform but almost over it, he’s pushed upwards unnaturally until he gets completely over.
It looks like a clumsy teleport which even makes you jump a little once in the platform.
To solve it,
we try to made our own one-way colliders. We put a trigger under the platform that makes the collider of the character a trigger on entering, so it won’t collide with the collider above, and makes the collider hard again when he’s out. Even with that, we’re having the exact same problem. It may be worth noting that our character is moving constantly, so it may affect Unity’s physics.
That’s why we’re asking, in case you have a solution or experience in this subject.
More info:
- We’re using Unity 5.4.0f3.
- We’re using layers to indicate to the character what is ground, wall, etc.
- Our character has a 2D circle collider and some raycasts to detect which kind of surface the collider is touching (since
- walls make you bounce automatically, etc.).
- When we tried the one-way method provided by Unity, not our attempted solution, we used a box collider 2D and a platform
- effector with “Use One Way” activated with the layer: Ground.
Thanks!