I have a sliding door with a simple trigger bool
When the opening animation is playing and the bool turns of i want to make the animation play backwards from were it left of, right now it just snaps to the closing animation.
I have a sliding door with a simple trigger bool
When the opening animation is playing and the bool turns of i want to make the animation play backwards from were it left of, right now it just snaps to the closing animation.
After some time i found out “Normalized Time” on the state and used it to scroll thru the animation.
This is the code i used.
private void Update()
{
if (colliding && GotItem())
progress += Time.deltaTime * animationSpeed;
else
progress -= Time.deltaTime * animationSpeed;
progress = Mathf.Clamp(progress, 0f, 1f);
animator.SetFloat(parameterName, progress);
}