Good afternoon.I have two layers in the animator for the upper body and for the lower, at one point I need to disable the layer for the upper body (for aiming the gun), so that I can adjust the current frame.How can I do this?
you can disable a layer by setting the LayerWeight .
public float animWeight = 0.5f;
public Animator anim;
void Start () {
anim.SetLayerWeight (2, animWeight);
}
You should also be able to do this in the Inspector example
You can find more informations under the following link from Unity https://docs.unity3d.com/Manual/AnimationLayers.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.