go | Root object of your transform hierarchy. |
rootMotionTransformName | Transform name of the root motion transform. If empty no root motion is defined and you must take care of avatar movement yourself. |
Create a new generic avatar.
function Start() { var go: GameObject = Selection.activeGameObject; if (go != null && go.GetComponent("Animator") != null) { var avatar: Avatar = AvatarBuilder.BuildGenericAvatar(go, ""); avatar.name = "Bob"; Debug.Log(avatar.isHuman ? "is human" : "is generic"); var animator: Animator = go.GetComponent("Animator") as Animator; animator.avatar = avatar; } }