I'm trying to shift between my character's default layer to another layer where his arms are masked smoothly so it looks like putting them out to hold a gun.
public bool gun;
void Update () {
if (gun) {
animator.SetLayerWeight (GunLayer, Mathf.Lerp (0.0f, 1.0f, Time.time));
}
}
Whenever gun is true I want the Layer Weight to lerp from 0 to 1 but it instantly goes to 1 if it is in a if condition block. When I take it out the if condition block it works perfectly but for my game I need to use an if condition.
↧