Hey ![]()
I converted an obj file to fbx. It contains openstreetmap3D data like buildings, trees, streets, …
After importing the asset and creating a prefab of it’s content I want to loop over some of the objects and place an new gameobject directly above them.
No matter if I could imagine different ways to achieve this I am pretty much struggeling with the following behaviour which seems pretty strange to me and I would like to understand it:
The parent element is placed at (0,0,0). All childs are also showing (0,0,0) in the inspector which is fine for me as these are the local coordinates relative to the parent. So far so good…
But in opposite to all self created gameobjects and their childs in my world i am not allowed to get the world coordinates by accessing the position attribute. No matter which function I am using it will always return (0,0,0).
this is my sourcecode in c#:
GameObject child_object = GameObject.Find("Building Commerzbank");
Transform myTrans = child_object.transform;
Transform myParent = child_object.transform.root;
Debug.Log("My world position = " + myTrans.position);
Debug.Log("My position relative to my parent = " + myTrans.localPosition);
Debug.Log("My parent's world position = " + myParent.position);
Debug.Log("manually transform= "+myTrans.localToWorldMatrix.MultiplyPoint3x4(myTrans.position));
output console:
sorry i don’t get it. As it works for other objects fine the problem may be in the fbx import. Is there something i could be missing in the export/import configs to get rid of this?
thanks in advance!!!
