2D Toolkit Forum
2D Toolkit => Support => Topic started by: fierceblaze on September 19, 2013, 02:34:15 am
-
Tile Map Rotate 90 Issue
I did not find this on the forum yet so I thought I would mention this here. I am sure that is because this is not the proper place for bug reporting so I am sorry if I am out of place here.
Prefab data is NOT rotated 90 degrees with the tile on the map. On commit it shown in it's original un-rotated state. It is very easy to simply go into the "Tilemap Render Data" and edit it after commit. I am sure, however, that it something that was unintentionally overlooked and will be fixed in the next hotfix.
-
What version of tk2d are you using here? I'm pretty sure this behaviour was changed at some point.
-
2.2 Final.
A tile can now be rotated... Yay!!! Been waiting for that!!!
The prefab associated to it by way of the data panel... Not automatically rotated with it...
-
Can you send a repro project of this issue to support at unikronsoftware.com, please. I think it is applying the transform twice, but its hard to tell without seeing how you've configured it.
-
I think it's not applying anything at all.
It's not an error it looks like an oversight.
It's not doing what I expect it to do.
Sometimes you have to see the issue so I reproduced it on an unlisted video on youtube...
http://www.youtube.com/watch?v=wBmReKFWBjk&feature=youtube_gdata
You can get the project files here... (2D Toolkit folder was removed to avoid piracy.)
https://mega.co.nz/#!QEhVyLJL!Dh5ltz7PpdmyvGNnO81YZX1YNKBN32H-8l7HPDAXRCw
-
Hey, any update on this, guys?
One of my games should be nearing completion very soon thanks to 2D Toolkit.
The new UI and tile map features allowed me to cut development time into weeks instead of months.
But level creation will be a huge pain in the butt without that fix.
What are your thoughts on the issue?
-
Yup, thanks for the repro case. Just remembered why we didn't implement it on prefabs - it was mainly to do with scaling and not rotation. Scaling a gameobject will result in the localScale being non uniform, and Unity doesn't like to batch non-uniform meshes.
Anyway, if you'd like to enable the lines in bold to tk2dTileMapBuilderUtil.cs
instance.transform.parent = parent;
instance.transform.localPosition = pos;
int rawTile = chunkData[y * tileMap.partitionSizeX + x];
Vector3 scale = prefabGameObject.transform.localScale;
if (BuilderUtil.IsRawTileFlagSet(rawTile, tk2dTileFlags.FlipX)) scale.x = scale.x * -1;
if (BuilderUtil.IsRawTileFlagSet(rawTile, tk2dTileFlags.FlipY)) scale.y = scale.y * -1;
instance.transform.localScale = scale;
Quaternion q = prefabGameObject.transform.localRotation;
bool rot90 = BuilderUtil.IsRawTileFlagSet(rawTile, tk2dTileFlags.Rot90);
instance.transform.localRotation = q * Quaternion.Euler(0, 0, rot90 ? -90 : 0);
// Add to tilePrefabs list
TilePrefabsX.Add(baseX + x);
TilePrefabsY.Add(baseY + y);