I am writing Objects to a MySQL database which is working but the rotation of the object is is wrong for example the Rotation on Y of the object is 45.00000 but the value being set in the Debug.Log is “Transform Y: -0.9704478”
On this transform there is no value that anywhere that this value equals I have no idea where it is coming from.
void prepData()
{
bodies = GameObject.FindGameObjectsWithTag("Savable");
_GameItems = new List<data>();
data itm;
foreach (GameObject body in bodies)
{
itm = new data();
itm.ID = body.name + "_" + body.GetInstanceID();
itm.Name = body.name;
itm.levelname = Application.loadedLevelName;
itm.objectType = body.name.Replace("(Clone)", "");
itm.posx = body.transform.position.x;
itm.posy = body.transform.position.y;
itm.posz = body.transform.position.z;
itm.tranx = body.transform.rotation.x;
itm.trany = body.transform.rotation.y;
itm.tranz = body.transform.rotation.z;
_GameItems.Add(itm);
Debug.Log("Transform Y: " + itm.trany.ToString());
}
Debug.Log("Items in collection: " + _GameItems.Count);
}