2d-extras
2d-extras copied to clipboard
Object getting stuck between tiles
Using composite collider doesn't work. I used a boxcollider2D and I got stuck between tiles. Object cannot move from one tile to another. It always stop at the edges(with gravity enabled).
Could you share images of your Collider2Ds in the scene?
The CompositeCollider2D can only take effect if the other Collider2Ds have the "Used By Composite" set. The CompositeCollider2D also needs to be placed at the same level at the Collider2Ds or in a parent GameObject.
nope. its not working. here are the pictures:
Could you show the SceneView where the objects are stuck?
here
I guess capsule collider is the best solution after all. But thanks your time anyway.
Hi, having a capsule collider for your character would be good for smoother movement. However, based on your screenshot, the blocks do not seem to be fully composited by the Composite Collider 2D? Meaning that the blocks should be fused to a single shape or neighbouring blocks should share the same edges where possible.
2019/7/25 Well, i tried doing that but composite doesn't seem to be doing the work properly. No matter what i do, it never regenerates a collider without some lines in the exact same place of the edges between tiles before i added a composite2D, which means adding it didn't solve the problem. But i solved my problem at last - by altering my boxcollider2D's Edge Radius from 0 to 0.01. Not sure what caused it, but a lot of people have this problem, seems to be the engine's problem.
maybe more methods here -https://forum.unity.com/threads/rigidbody-getting-stuck-on-tiled-wall.220861/