I have planes attached to various objects that I always want rotated in a certain way (where the plane is locked, not the parent object), so I use the following code:
private var fixedRotate : Quaternion = Quaternion.identity;
function FixedUpdate () {
transform.rotation = fixedRotate;
}
This works on every object except ones created from a certain prefab (the only significant difference being the model, but the others use a variety of different models with no problems).
Any time I use this with objects from that prefab it will end up with an odd result, leaving the plane attached to it at a skewed angle relative to all the others (except when I have the initial position at 0 or 180 degrees at time of instantiation in which case it also works, but I can’t effectively use that as a workaround).
I’ve been unable to find anything to suggest what the underlying problem might be, and all my attempts at a workaround have failed (I even tried grabbing the transform.rotation from a properly oriented plane at runtime with no luck). As far as I can tell, this prefab just renders global coordinates differently than it should for some reason (but that’s a total guess). Any ideas on what might be the problem/solution?
Thanks