Search Issue Tracker
By Design
Votes
1
Found in
4.3.3f1
Issue ID
587600
Regression
No
Adding a polygon collider 2d on runtime via script is broken on builds
To reproduce:
1. Open attached project
2. Open scene "screen". It contains a sprite and a script that attaches a polygon collider 2d component. There is also a script that draws the outlines of the collider
3. Run the scene - the collider looks nice
4. Build and run - the collider is somewhat random and not like the sprite at all
Comments (3)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
kcarroll_cmm
Jul 31, 2014 19:35
Any traction on this? I am using Unity 4.5.2f1 and it is still a problem.
joe_raised
Apr 28, 2014 12:02
I am having this exact same problem, but the suggested fix/work around does not work.
I have my textures in a Resources folder.
I have them set to Texture type 'Advanced'.
I have Read/Write enabled.
When I load them dynamically when testing, they work great. When they load via a build (Web, x86, Mac OSX) they all generated a seemingly random off centre PolygonCollider2D mesh.
Here is a textures .meta file:
fileFormatVersion: 2
guid: 825af6a76cab540b49cd6d74a9b0c867
TextureImporter:
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 1
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 5
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
TomasJ
Mar 26, 2014 10:45
In order to generate a Sprite outline, the texture must be readable. Otherwise pixel data is pushed to GPU and discarded.
Set Read/Write Enable in the texture importer to fix this