I’m getting skew of a child object as mentioned on the Unity Script Reference Transform.lossyScale page http://unity3d.com/Documentation/ScriptReference/Transform-lossyScale.html. I have an oblong sphere rotating and a child 3D Text object that I would like to hang above the sphere without rotating with the sphere. I’m using a script something like this:
function Update() {
if (!transform.parent)
return;
// update position and rotation to look at camera
transform.position = transform.parent.position;
transform.position.z = transform.position.z + 1;
transform.eulerAngles = Vector3(90, 0, 0);
}
I would like to keep the text as child for organization, prefab, scripting, and other reasons, but I can’t figure out how to counteract the skew. Options I can think of are: a) figure out how to properly counter-act skew/rotation/etc. in realtime; b) have it be a child without being “transform child”; or c) when the scene launches, have the text drop out of being a child but still retain connections to work properly.
Let me knew what would work and would be the best, easiest way to go. Thanks.