How do i make the collider layer more efficient?


(Ken Carpenter) #1

I am using tiled2unity as im stuck with unity 2017.4 and im having issues with the super version. Just started a few weeks ago. I’m able to export the map and objects into unity but the collider layer it creates has a huge list of polygon colliders attached to it. It takes 3-4 mins just to select/click the layer in unity. I have been told i should only have about 3 or 4 colliders per game object.

Are there any way to improve the performance maybe by merging all of the polygon colliders into a single one? Is that possible?


(魔大农) #2

You could draw colliders on a separate layer using the polygon tool.

I’m unaware of a way to merge these or base them on tile collision shapes in Tiled. But that would seem like a nice feature to have.

You could also maybe make this a part of your map loading.


(Thorbjørn Lindeijer) #3

He mentioned he is using Tiled2Unity, and taking collision shapes set on tiles and merging them into a single efficient collision shape is one of its primary features.

Tiled2Unity is no longer supported and people should move on to the new SuperTiled2Unity, but it may be that @Seanba or somebody who has used Tiled2Unity can answer this question.


(Seanba) #4

That depends on the size and complexity of your map and how the colliders from neighboring tiles group together to form larger polygons. Can you send us a screen shot of a tile in the Collision Editor (in Tiled)? I suspect the collisions on it are two small are therefore are not good candidates for merging.

And out of curiosity, what’s keeping you on Unity 2017.4?


(Ken Carpenter) #5

I’m stuck with Unity 2017.4 for my game release because of other asset per-requisites and I am not comfortable switching versions in-between releases.

Here’s a few example tiles in collider editor I’m using for coastline.
image
image
image

I use these kinds of tiles like this all around the map.
image

I use them thousands of times and the collider layer has too many polygon colliders attached to it after exporting to unity and it makes it really slow in unity.

Any assistance is appreciated.


(Seanba) #6

If you send me your Tiled files (TMX, TSX, textures) I may be able to get a better idea of what is going on.

sean@seanba.com

Thanks.