Search Issue Tracker
Fixed in 2018.2.X
Votes
0
Found in
2017.3.0f3
Issue ID
1001136
Regression
No
[Tilemap] 2D Tiles do not rotate. Calling tileData.transform.SetTRS has no effect on the tile's rotation
How to reproduce:
1. Download attached project file and open "DemoScene" Scene
2. Enter Play Mode
3 Select "Build Wall" button and build a horizontal line of walls (you will notice that the correct tile is used in each grid (e.g. end wall, or middle wall) but they are rotated wrongly. The debug log is outputting the rotation value that it is trying to set them at)
Actual result: Calling tileData.transform.SetTRS(Vector3.zero, GetRotation(mask), Vector3.one); in GetTileData() has no effect on the tile's rotation. My tiles are always placed in their original/default rotation.
Reproduced with: 2017.2.1p3, 2017.3.1p1, 2018.1.0b7
Comments (1)
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
- Crash on JobQueue::HasJobGroupIDCompleted when closing the Editor while in Play mode on a specific project
- In "Preferences" section the “SpriteShape” menu item, the details page title “SpriteShape”, and “ControlPoint” entries are displayed as code strings rather than formatted UI strings
- Errors thrown constantly when Virtual Offset Debug is enabled and lighting was baked on AMD machine
- Persistent Memory Leak when reloading domain and using Distance-based Ghost Importance
- HDRP project doesn't render in standalone player when using High stripping
St000
Feb 28, 2018 14:14
Solution from Unity QA for anyone googling:
The example here (https://docs.unity3d.com/Manual/Tilemap-ScriptableTiles-Example.html) is outdated and we will update it.
The issue here is tileData.transform returns a copy of the Matrix4x4 and since it is a struct, by doing tileData.transform.SetTRS() does not set the actual copy of the Matrix4x4 hold by tileData. The correct code should be
var m = tileData.transform;
m.SetTRS(Vector3.zero, GetRotation(mask), Vector3.one);
tileData.transform = m;