Quantcast
Channel: Questions in topic: "weight"
Viewing all articles
Browse latest Browse all 136

How do I smoothly shift between Layer Weights

$
0
0
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.

Viewing all articles
Browse latest Browse all 136

Trending Articles