- Home /
Question by
titanium356798 · May 20, 2021 at 05:01 PM ·
unity 5not workinglayersanimation controllerhow to
Answer for How to Disable or Enable a layer of animator controler?
// Use this in the start of the class: " Animator animator; "
// just add this
// the arguement is asking which layer
currWeight = animator.GetLayerWeight(1);
if (Input.GetKey(KeyCode.Mouse0))
{
// Use this in the start of the class: " Animator animator; "
// the first arguement is for the layer they are asking which the number of the layer
// the second arguement is asking the weight of the layer
animator.SetLayerWeight(1, 1);
}
if (!Input.GetKey(KeyCode.Mouse0))
{
// the first arguement is for the layer they are asking which the number of the layer
// the second arguement is asking the weight of the layer
animator.SetLayerWeight(1, 0);
}
Comment