[1173-Araucaria_unity.zip|1173].
It contains objects with dislocated rotation axis / pivot. So, when I try to apply a billboard script to it, it simply doesn’t work.
The simplest solution would probably be to fix it on 3DS, Maya, Blender, etc, but I wanted to do it in script for whatever reason. And I couldn’t, even after a lot of research.
I do realize I could manually adjust them using an empty parent, but there are 100 leaves there and that would be way too troublesome. We could also move it using RotateAround, but I couldn’t figure out a way to script it into the Billboard because we can’t set it into a value (rather than moving).
Also using UnifyCommunity’s SetPivot didn’t work very well on the FBX - it did center the Pivot, but it moved the leaf out of its original position and into the pivot position.
So, there are 2 questions here:
- How to adjust the pivot on that FBX, using scripts only?
- How to do it at run time only?
If that’s even possible.
Sorry, looks to me the model is shot. The leaves don’t have any useful local coordinates at all - they are all the same. So the information where each leaf is supposed to be connected is lost, and it is not contained in the .fbx.
You could still write a script that finds the center of each leaf by looping over all leaves and accessing their renderer.bounds.center, then inserting a new GameObject at the stem, setting its transform.position to that center, then reparenting the leaf to that object, which will make the leaf’s center the “origin” of that parent object. You can then rotate that parent object, and this will rotate the leaf around its actual center.
But this would still be an approximation, since the leaves are not necessarily connected to the branches at their center, in fact each leaf seems to have an eintirely different (relative) place where it is connected to its branch. Most importantly, their rotation will still be wrong (which is why your billboarding script is failing, even if the center of rotation has been corrected as described above). This could also be fixed, but would require more extensive and complex scripting mathematics.
So your only chance is to fix the original model and reimporting that into Unity. If that’s not possible, it will still be faster to completely remodel the trees, or find others in the web 
Realtime engines do not support the concept of a pivot point that is not at 0,0,0
to “fix” in the art package, simply move the verts of your objects to make 0,0,0 to be the pivot you want,