Hi all,
I am working with GameObjects, which are created by script and which are hierachically attach to each other like this:
var go = new GameObject("Parent");
go.transform.parent = parentObject.transform;
But I run into one thing, I don’t understand. When I
- create a parent
- rotate it by 45 degrees
- create a child
- attach a child to parent
the child somehow compensates the parent transform e.g. having a y-rotation of 315 after this procedure. Even setting the rotation to Quaternion.Identity won’t fix this problem!
If I do step 2 as the last step, the problem does not occur. Unfortunately, that’s not always possible for me.
Why does Unity3D this and how can I avoid it?
If necessary I can provide sample code for this issue.
Regards,
Jonas