# Problem with edge collider and rotated tile

**URL:** <https://discourse.mapeditor.org/t/problem-with-edge-collider-and-rotated-tile/1562>\
**Category:** Questions\
**Created:** [August 10, 2016, 5:02am UTC](https://discourse.mapeditor.org/t/problem-with-edge-collider-and-rotated-tile/1562 "2016-08-10T05:02:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Exuro89](https://avatars.discourse-cdn.com/v4/letter/e/50afbb/32.png) [@Exuro89](https://discourse.mapeditor.org/u/Exuro89)\
**Post date:** [August 10, 2016, 5:02am UTC](https://discourse.mapeditor.org/t/problem-with-edge-collider-and-rotated-tile/1562/1 "2016-08-10T05:02:14Z")

</div>

Hi,

I’m new to using Tiled and am having a problem with the collision system when rotating a tile. I have a corner tile which I added a polyline to 2 edges to create the edge collider in Unity. On one of the rotations the poly line is not correct. Below is an image of the issue.

![](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/mapeditor/original/1X/01994f847893b4a9ac9166729a9f8791f9e80de2.png)

The first three tiles have the edge collider assigned correctly. The last one is intersecting through the tile instead of going along the edge. Is there something I’m doing wrong or some setting I need to use to make sure all rotations work correctly? Or perhaps is this an issue with Tiled2Unity which I’m using to export?

Thanks

---

<div class="post-metadata">

**Author:** ![Seanba](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/seanba/32/1531_2.png) [@Seanba](https://discourse.mapeditor.org/u/Seanba)\
**Post date:** [August 19, 2016, 4:16pm UTC](https://discourse.mapeditor.org/t/problem-with-edge-collider-and-rotated-tile/1562/2 "2016-08-19T16:16:16Z")

</div>

Hi there. Can you email me your example? A small TMX file and the texture it references should be enough to help me debug. You can find my email on my website: [www.seanba.com](http://www.seanba.com)

---

<div class="post-metadata">

**Author:** ![Exuro89](https://avatars.discourse-cdn.com/v4/letter/e/50afbb/32.png) [@Exuro89](https://discourse.mapeditor.org/u/Exuro89)\
**Post date:** [August 19, 2016, 4:39pm UTC](https://discourse.mapeditor.org/t/problem-with-edge-collider-and-rotated-tile/1562/3 "2016-08-19T16:39:20Z")

</div>

I’ve emailed an example tmx file that reproduces the issue along with the spritesheet.

Thanks

---

<div class="post-metadata">

**Author:** ![Seanba](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/seanba/32/1531_2.png) [@Seanba](https://discourse.mapeditor.org/u/Seanba)\
**Post date:** [August 20, 2016, 2:29am UTC](https://discourse.mapeditor.org/t/problem-with-edge-collider-and-rotated-tile/1562/4 "2016-08-20T02:29:38Z")

</div>

It looks like it’s a bug with the (otherwise rock-solid) Clipper library when you have open paths (i.e. polylines) with just two edges. I’m going to debug some more but I may need to call in to the author of Clipper for backup. In the meantime, if you can work with polylines with 1 edge or more than 2 edges then you should be okay.

---

<div class="post-metadata">

**Author:** ![Exuro89](https://avatars.discourse-cdn.com/v4/letter/e/50afbb/32.png) [@Exuro89](https://discourse.mapeditor.org/u/Exuro89)\
**Post date:** [August 20, 2016, 5:03am UTC](https://discourse.mapeditor.org/t/problem-with-edge-collider-and-rotated-tile/1562/5 "2016-08-20T05:03:19Z")

</div>

Thanks for the quick response. I’ll just close the paths with a third line since that sounds like the easiest solution.

---

<div class="post-metadata">

**Author:** ![Seanba](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/seanba/32/1531_2.png) [@Seanba](https://discourse.mapeditor.org/u/Seanba)\
**Post date:** [August 29, 2016, 11:27pm UTC](https://discourse.mapeditor.org/t/problem-with-edge-collider-and-rotated-tile/1562/6 "2016-08-29T23:27:07Z")

</div>

Good news. The Clipper author made a fix for this I was able to roll into the Tiled2Unity. If you download version 1.0.7.8 this should be fixed. Thanks for the bug report.
