2D Toolkit Forum
2D Toolkit => Support => Topic started by: bmyu on June 22, 2014, 01:37:02 pm
-
When tilemap is created like http://image.kilho.net/?pk=1642601 (http://image.kilho.net/?pk=1642601) and tile collider type is Box-Trimmed, the red line collider part remains collapsed.(Raycast2D doesn't detect that lines.)
Also when collider type is polygon, no matter what collider cap is, http://image.kilho.net/?pk=1642612 (http://image.kilho.net/?pk=1642612) the red line collider part remains collapsed.
Physics Engine mode is 2d.
Help !
-
Collapsed how? Please post a repro case or a picutre of the collider itself.
-
Edit - removed dropbox link
Here is the unity project.
Tilemap is in the Tilemap folder.
Character things are in Character folder.
-
Hi,
I've just had a look and I'm not sure what is wrong with your specific code. Your code seems to work fine with solid colliders (eg. box, etc), but doesn't seem to work properly with edge colliders, and is reproducible with any old box with edge colliders applied by hand. You should probably look into unity forums / answers about edge colliders and raycasts to see if there are any known issues like this / if there are any solutions.
-
OK I found the problem is collider.normal.
Even if the edge collider looks vertical, it's inclined very slightly.. I ignored collision with inclined block due to handle slope tiles. Thanks!
But another question. I questioned before, http://2dtoolkit.com/forum/index.php/topic,4180.0.html (http://2dtoolkit.com/forum/index.php/topic,4180.0.html), In the same project, the block in question is in my tile sprite collection, 99th (last) tile block.
Compare collider which is seen by sprite collection editor with collider which is created on the scene.
Maybe you've deleted the project already, so here is the project.
Edit - removed dropbox link
-
Just had a look, not sure what I'm looking for. They look identical as far as I can tell?
-
What do you see if you edit the polygon collider in the viewport once its created?
-> Vertices are not collapsed in viewport edit mode. But when rigidbody2D is attached, collider doesn't work well.
-
The rigidbody is attached to that sprite with the weird shapes? Or is something else having problems colliding with this thing?
-
Collider itself is weird.
Editing collider in viewport(with shift key), I can find every vertices that I made. But without shift key, in viewport, the actual collider polygon made of green lines, some vertices are ignored.
-
Looks exactly the same with or without the shift key.... what do you see?
-
Here is the video. http://youtu.be/6o83zb4kbtc (http://youtu.be/6o83zb4kbtc)
-
Ah I see it now. Its a bug with the unity polygon collider 2d :( You can reproduce it when trying to create the same shape manually in Unity.
-
I noticed the bug occurs when collider is very small.
Unity should fix this quickly.
-
Please report it the bug, in an isolated project without tk2d ideally for the highest chance of them fixing it.