2D Toolkit Forum

2D Toolkit => Support => Topic started by: xeriku on August 12, 2013, 03:22:10 am

Title: Tilemap Mesh Collider Seams & Sprites
Post by: xeriku on August 12, 2013, 03:22:10 am
Hello,

First, I wanted to say that I love 2d toolkit. It is a godsend for dealing with 2d in Unity. I have been getting along just find with the documentation thus far, but I've run into an issue that I cannot figure out. In my tilemap, I was noticing that whenever my sprite was moved against certain collision points, the sprite would slow down (almost as if the drag had been increased on the rigid body). I finally looked at the render data and saw that the locations that these "slow downs" were occurring were against mesh collider seams. I am not sure where to go from here. I have double checked everything that I can think of from making sure my colliders were the same size for each frame on my animated sprite, I'm just not sure why I am experiencing this drag when I come upon mesh collider seams with my sprite. I can confirm that this happens 100% of the time when crossing the mesh collider seams on the tilemap. I have included a picture of my render data as well the settings of the rigid body on my animated sprite along with the collider settings for the tile sprite collection and player sprite collection.

Collider Seams
(http://i.imgur.com/YMxzHh3.png)

Animated Sprite Collider and Rigid Body Settings
(http://i.imgur.com/pigMCAd.png)

Tileset Collection Settings
(http://i.imgur.com/Ez7LdYP.png)

Animate Sprite Collection Settings
(http://i.imgur.com/PRbrBQb.png)

The tileset and sprite collider types are all set to Box Trimmed with Render Mesh set to Double Sided. Any and all help is appreciate, if you need more information from me, I would be more than happy to provide it.


Thanks!
Title: Re: Tilemap Mesh Collider Seams & Sprites
Post by: unikronsoftware on August 12, 2013, 12:02:13 pm
The seams seem to be at partition boundaries? The tilemap is split up into partitions to allow you to create much much larger tilemaps than would otherwise be possible. Unity has a known issue with rigidbodies straddling collider boundaries - this happens with normal boxes too, if you align them perfectly.

Are you using the character controller?
Title: Re: Tilemap Mesh Collider Seams & Sprites
Post by: xeriku on August 12, 2013, 01:16:42 pm
I'm not using the CharacterController at the moment, just something I wrote in a few minutes. Would that help this situation out?
Title: Re: Tilemap Mesh Collider Seams & Sprites
Post by: unikronsoftware on August 12, 2013, 01:26:30 pm
As far as I know, the character controller doesn't suffer from this as it doesn't use rigid bodies.
Title: Re: Tilemap Mesh Collider Seams & Sprites
Post by: xeriku on August 12, 2013, 05:42:12 pm
I will give that a go. Thank you for the quick turnaround on this! Keep up the awesome work.
Title: Re: Tilemap Mesh Collider Seams & Sprites
Post by: xeriku on August 12, 2013, 09:06:13 pm
I will give that a go. Thank you for the quick turnaround on this! Keep up the awesome work.

Honestly, I felt like the Rigid body with its issues were better than the character controller. Being limited to a capsule collider in box on box collision is kind of painful. I am finding myself rounding corners where I shouldn't, as well as having unpredictable collision against mesh colliders. Is this to be expected with the character controller?
Title: Re: Tilemap Mesh Collider Seams & Sprites
Post by: xeriku on August 12, 2013, 09:42:01 pm
I will give that a go. Thank you for the quick turnaround on this! Keep up the awesome work.

Sorry for the triple post, I got this going with the character controller and capsule collider. My player game object somehow got an additional collider attached that was collapsed. Removed that and all is well in the world.


Thanks again!