- Home /
PolygonCollider2D too big
Hey guys,
i generated some two-dimensional textures tiles while runtime and added them to the spriterenderer. all for a procedural jump'n'run without a prefab set of possible tiles.
My problem is, that after adding a collider to the sprite, it is mostly to big. I tried to scale the the object to achieve a high pixels-to-units rate but this makes no difference. Also i looked for hard edges on the texture, so there is no squishy alpha. So my ideas are depleted.
(256 x 256 pixels and now scaled to 128 pixels to units (not in the image))
Thx for any ideas
Answer by Dknighter2 · Apr 28, 2015 at 05:35 PM
You can edit each polygon , I think it's shift then click and drag each point.
A way to saving modification done in runtime is to drag your object from hierachy to a project folder. You will create a prefab .. That's not good as save not in runtime and some elements could be missing (meshes,..)
Answer by Totoro205 · Apr 15, 2018 at 12:30 AM
Hello, I was wondering if there's a way to do it inside the script? I'm generating an array of points and setting the path of the polygon collider from the code (it changes in runtime very often) so it's not possible to rescale it manually. I would appreciate any help.
Your answer

Follow this Question
Related Questions
RenderTexture not working correctly 0 Answers
Trouble with Inaccurate Mesh Collider 0 Answers
2D collisions on a Game Object Sprite with transparent areas 2 Answers
Editing Polygon Collider 2D Mesh by Script 1 Answer
Unity2D: Renderer off/ on by triggers 0 Answers