- Home /
Question by
D-Coy · Oct 01, 2017 at 10:51 AM ·
blendshapessmoothdampmathf.lerp
ease in and out between blendshapes
Just trying to ease between 2 blendshapes. Read docs but cant get it working. Any help would be appreciated
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class lerpTest : MonoBehaviour {
private SkinnedMeshRenderer skinMeshRenderer;
float newMove = 100f;
void Start()
{
skinMeshRenderer = GetComponent<SkinnedMeshRenderer>();
}
void Update()
{
if (Input.GetKeyDown(KeyCode.A))
lerper();
}
void lerper()
{
skinMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(0, newMove, Time.deltaTime));
}
}
Comment
Best Answer
Answer by D-Coy · Oct 01, 2017 at 03:25 PM
there seems to be no information on this. Is it not possible?
turns out mathf.lerp doesnt do what I thought. What I needed was smoothDamp to ease in between blendshapes
blendEase = $$anonymous$$athf.SmoothDamp(0,100, ref yVelocity, smoothTime);