I am following this example to create a scriptable tile: Unity - Manual: Scriptable Tile example
Everything seems to work fine except the rotation of the tile.
In the GetTileDate method I have this:
Debug.Log("Index; " + mask + " for " + location);
tileData.sprite = m_Sprites[index];
tileData.color = Color.white;
Quaternion q = GetRotation((byte)mask);
Debug.Log(q.eulerAngles);
tileData.transform.SetTRS(Vector3.zero, q, Vector3.one);
Debug.Log(tileData.transform.rotation.eulerAngles);
//tileData.flags = TileFlags.LockTransform;
tileData.colliderType = ColliderType.None;
The console output shows that I do ge a rotation from the GetRotation. It is usually (0,0,90f) however setting this using the SetTRS doesn’t have any affect…
The tileData.transform.rotation always seem to be (0,0,0).
What am I doing wrong here?
edit: I’ve done some testing and it looks like it’s not just the rotation but everything…
tileData.transform.SetTRS(Vector3.one, GetRotation((byte)mask), Vector3.one*2);
I’ve set this as a test and nothing got applied…