# Collision detection not transfering to Unity. Please help

**URL:** https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571
**Category:** Questions
**Created:** [June 10, 2015, 1:44am UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571 "2015-06-10T01:44:41Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Markeus\_Brum](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Markeus\_Brum](https://discourse.mapeditor.org/u/Markeus_Brum)
#### Post date: [June 10, 2015, 1:44am UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/1 "2015-06-10T01:44:41Z")

</div>

So I built a map in tiled and I added the the tile collision tilesets to the map but for some reason when I I run the game in unity the collision detection just doesn’t work at all. I get this message stating the collider did not create any collision shapes as they all failed verification. I can send the build over If you need me to, I just need help.

---

<div class="post-metadata">

### Author: ![TilemapKit](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/tilemapkit/32/255_2.png) [@TilemapKit](https://discourse.mapeditor.org/u/TilemapKit)
#### Post date: [June 10, 2015, 8:13am UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/2 "2015-06-10T08:13:35Z")

</div>

Does the TMX loader you are using actually support loading the collision information from Tiled/TMX? Many loaders just don’t do that because it’s a relatively new feature.

---

<div class="post-metadata">

### Author: ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)
#### Post date: [June 10, 2015, 9:10am UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/3 "2015-06-10T09:10:23Z")

</div>

It sounds like you’re using [Tiled2Unity](http://www.seanba.com/introtiled2unity.html). In that case let’s hope @Seanba can help you.

---

<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: [June 11, 2015, 6:29pm UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/4 "2015-06-11T18:29:59Z")

</div>

If you’re using Tiled2Unity I can provide some pointers.

I’ve seen collision shapes fail verification when the vertices are packed in too close together or if the collision shape is made up of too many vertices. Are you using “Snap To Grid” or “Snap To Fine Grid” when creating collision geometry in the Tiled Collision Editor? I find many newcomers to Tiled create polygons haphazardly not realizing their polygon cooridinates are in floating point (sub-pixel) values.

---

<div class="post-metadata">

### Author: ![Markeus\_Brum](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Markeus\_Brum](https://discourse.mapeditor.org/u/Markeus_Brum)
#### Post date: [June 16, 2015, 1:55am UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/5 "2015-06-16T01:55:30Z")

</div>

Hey Thanks for the response! I am using Tiled2Unity but I did not use the Snap to Grid or Snap to Fine Grid feature. I imported a red box tile I created and used that as the collision tile. Then I opened up the collision editor in tiled and placed the tiles on top of the assets I wanted the character to collide into. I’ll try out the Snap to Grid feature and will let you know if I need further assistance, Thanks a bunch!

---

<div class="post-metadata">

### Author: ![Markeus\_Brum](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Markeus\_Brum](https://discourse.mapeditor.org/u/Markeus_Brum)
#### Post date: [June 16, 2015, 1:57am UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/6 "2015-06-16T01:57:04Z")

</div>

Thanks for the reponse

---

<div class="post-metadata">

### Author: ![Markeus\_Brum](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Markeus\_Brum](https://discourse.mapeditor.org/u/Markeus_Brum)
#### Post date: [June 17, 2015, 12:45am UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/7 "2015-06-17T00:45:31Z")

</div>

It’s not budging. Would you kindly take a look at it to see what’s going on with it? I can just export the package and send you the dropbox link via email.

---

<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: [June 17, 2015, 1:09am UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/8 "2015-06-17T01:09:55Z")

</div>

If you send it me I’ll take a look. You can get my email from my blog where you downloads Tiled2Unity from.

Edit to add: Might be a good idea to send me your Tiled (\*.tmx) file and associated textures just in case it’s something with the way the Tiled map is authored.

---

<div class="post-metadata">

### Author: ![Markeus\_Brum](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Markeus\_Brum](https://discourse.mapeditor.org/u/Markeus_Brum)
#### Post date: [June 18, 2015, 11:06pm UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/9 "2015-06-18T23:06:39Z")

</div>

will do thanks.

---

<div class="post-metadata">

### Author: ![Markeus\_Brum](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Markeus\_Brum](https://discourse.mapeditor.org/u/Markeus_Brum)
#### Post date: [June 24, 2015, 12:55am UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/10 "2015-06-24T00:55:36Z")

</div>

Thanks to @Seanba I finally got it! It was actually a simple fix. All the collision data was transferring to unity through tiled to unity but I didn’t set up a box collider around my character. 😜 The character is now colliding with the tiles and everything is running smoothly, THANKS!

---

<div class="post-metadata">

### Author: ![Chase\_Cromwell](https://avatars.discourse-cdn.com/v4/letter/c/bb73d2/32.png) [@Chase\_Cromwell](https://discourse.mapeditor.org/u/Chase_Cromwell)
#### Post date: [December 29, 2015, 5:41am UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/11 "2015-12-29T05:41:49Z")

</div>

@Markeus_Brum @Seanba

What do you mean “set up box collider around character”? Ive been trying for **_weeks_** to get this to work.

---

<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: [December 29, 2015, 6:04am UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/12 "2015-12-29T06:04:45Z")

</div>

Hi Chase, if you could be a bit specific about what you’re seeing and what’s not working for you I’m sure we can provide some direction. Does your exported prefab have colliders on it? Do your sprites? Do you have a rigid body on your sprite?

You may also want to look at some examples I’ve made. They have sprites colliding with geometry and come with all Tiled and source files. They may go a long way to helping you figure out what you’re missing.

> **[Seanba/Tiled2Unity-MegaDad](https://github.com/Seanba/Tiled2Unity-MegaDad)**
>
> Introducing Mega Dad Adventures test suite for Tiled2Unity to GitHub - Seanba/Tiled2Unity-MegaDad

What Markeus is talking about is that his sprite needed a collider on it that would collide with the colliders on the level he exported from Tiled2Unity into his Unity project. Does that make sense?

---

<div class="post-metadata">

### Author: ![Markeus\_Brum](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Markeus\_Brum](https://discourse.mapeditor.org/u/Markeus_Brum)
#### Post date: [December 29, 2015, 10:17am UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/13 "2015-12-29T10:17:47Z")

</div>

Post a couple of screenshots of what exactly you’re having issues with. I’m sure its going to be the simple fix I had to implement.

---

<div class="post-metadata">

### Author: ![Chase\_Cromwell](https://avatars.discourse-cdn.com/v4/letter/c/bb73d2/32.png) [@Chase\_Cromwell](https://discourse.mapeditor.org/u/Chase_Cromwell)
#### Post date: [December 29, 2015, 11:32pm UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/14 "2015-12-29T23:32:57Z")

</div>

How were you able to get the polygon collider 2d to go around the objects set to be a collider? In the tiled editor, I’ve set the tile I’m using as a collier to be an obstacle using view\>tile collision editor. I then selected the map and exported it.

Edit:

I added my collisions after my first export, and didn’t reload the prefab so the scene wasn’t up to date. All is well.

---

<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: [January 1, 2016, 6:32am UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/15 "2016-01-01T06:32:47Z")

</div>

Glad you got it working, Chase. I’ve been burned by prefabs before as well. I think they will always be automatically reloaded unless you make an edit to them in your scene hierarchy. FWIW, I encourage the use the Custom Importers so that you never have to edit a prefab by hand.

Have a great 2016.

---

<div class="post-metadata">

### Author: ![DCoward](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DCoward](https://discourse.mapeditor.org/u/DCoward)
#### Post date: [June 16, 2016, 6:42am UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/16 "2016-06-16T06:42:16Z")

</div>

I hate to necropost, but I’m still having some problems.

Granted, new to Unity and Tiled/T2U, but I thought I understood fairly well.

I definitely put the collisions, but for some reason, it seems they aren’t working for me either.

My character has a Rigidbody and Box Collider, but I still go through the colliders that were loaded in by T2U from the original map.

---

<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: [June 16, 2016, 2:26pm UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/17 "2016-06-16T14:26:47Z")

</div>

> [@DCoward](#):
>
> … but I still go through the colliders that were loaded in by T2U …

What about colliders that are not loaded by Tiled2Unity? I’d try to simplify the problem as much as possible with your character and perhaps a box or polygon collider that you placed in your scene by hand. That way you can get general help from the Unity forums if you’re still stuck. (Collision problems are very common and Unity forums are well equipped to offer advice.)

---

<div class="post-metadata">

### Author: ![DCoward](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DCoward](https://discourse.mapeditor.org/u/DCoward)
#### Post date: [June 16, 2016, 10:46pm UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/18 "2016-06-16T22:46:37Z")

</div>

Fair enough, you’re on to something.

I toyed around some and it seems it has something to do with my movement script, as when disabling the kinematic nature of a sprite, I can FALL onto a collision, but I still move through them.

Would you happen to know off the top of your head where to point me (or do you know this to be a common problem and know how to fix it), because I’m a bit unsure of what exactly I need to alter to make it all cooperate?

---

<div class="post-metadata">

### Author: ![DCoward](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DCoward](https://discourse.mapeditor.org/u/DCoward)
#### Post date: [June 17, 2016, 10:43am UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/19 "2016-06-17T10:43:56Z")

</div>

Well, I’m silly.

I didn’t notice the COLLISION DETECTION PART of the Rigidbody.

I am derplord.

Alright, mostly great now, though I’m still a bit confused of where to go now, since now I can still make myself move into the collision zones, or go through them. I suspect this is due to my move script, since I move a set amount at a time, which might make me go through the collisions (or try to – I definitely face resistance now).

Any ideas or anyone know exactly what to do?

---

<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: [June 17, 2016, 10:40pm UTC](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571/20 "2016-06-17T22:40:13Z")

</div>

Hi DCoward, our host is pretty cool but this is a Unity issue and not really related to Tiled so we should move the discussion onto the Unity forums.

But while I have you, if your code is moving your character around by setting their position then that could be the problem. The character controllers normally have a “Move” function that properly checks against collisions.

[Next page](https://discourse.mapeditor.org/t/collision-detection-not-transfering-to-unity-please-help/571.md?page=2)
