Search Issue Tracker
Fixed in Unity 2018.2
Sprite.Create() is Creating a sprite with incorrect bounds
How to reproduce:
1. Open QA provided stripped project "SpriteCreateBounds.zip"
2. Enter play mode
-- Notice one sprite is at the centre of camera viewport, and another one is perfectly following the mouse
3. Exit play mode and open "ColourPlacementCircle.cs"
4. Comment out line 41 (Sprite.Instantiate) and uncomment line 42 (Sprite.Create)
5. Enter play mode again
-- Notice that both sprites are offset to bottom left and not visible on the screen
Sprite.Instantiate() Bounds: Center
Sprite.Create() Bounds: -496, -496
Reproduced on: 2017.1.3f1, 2017.2.1p2, 2017.3.0p2, 2018.1.0b3, 2018.2.0a1
By design - Updated docs to reflect actual behaviour.
The correct pivot value that is passed into Sprite.Create should be normalized to (0,0) -> (1,1) where (0,0) is bottom left, (1,1) is top right (center will be (0.5, 0.5))
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Unity Ads Package conflict with Moq framework
- Particle system trails sprites modifies unexpectedly when Texture Sheet Animation is enabled
- "Density" in "Buoyancy Effector 2D" description is inaccurate and difficult to understand
- Some Isometric Tiles are not Rendered on the Tilemap when using "Chunk" Mode on the Tilemap Renderer
- Input.GetKeyUp and Input.GetKeyDown always Return False when used in the Coroutine with WaitForEndOfFrame Return type