Hello.
I am trying to render a avatars head to a scale of zero, but only for one camera.
This is meant for VR and should enable users to upload their own avatars easily and my game just “disables” the head rendering.
I ran into a problem though: I am using OnPreRender and OnPostRender, setting the scale of the head (Retrieved via Animator.GetBoneTransform) to zero and in Post back to it’s original.
The result was expected to render the head only for the attached camera to zero, but the scaling never happens. The only thing that does happen, is that child objects move to a different position.
public Animator Anim;
private void OnPreRender()
{
if (Anim != null)
{
Anim.GetBoneTransform(HumanBodyBones.Head).localScale = Vector3.zero;
}
}
private void OnPostRender()
{
if (Anim != null)
{
Anim.GetBoneTransform(HumanBodyBones.Head).localScale = Vector3.one;
}
}
Any help or a different solution on how to disable the head would be very appreciated.
Thanks.