Question by
Magmaw · Nov 17, 2019 at 08:26 PM ·
animationscripting problemanimationcurve
Animation in script looking jittery?
Hi, I'm animating an object to increase its scale from 0 to 1 using a script. For some reason, the animation looks kind of jittery in-game. Here's my code:
IEnumerator Elevate(float timeTaken)
{
Vector3 originalScale = projector[0].transform.localScale;
float amountToScale = 1;
float elapsedTime = 0f;
while (elapsedTime < timeTaken)
{
projector[0].transform.localScale = new Vector3(originalScale.x + projUpCurve.Evaluate(elapsedTime / timeTaken) * amountToScale, originalScale.y, originalScale.z);
elapsedTime += Time.deltaTime;
yield return null;
}
}
Thanks.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612214928im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Animator Position VS Script Vector 3 0 Answers
Making your ai attack then return to the navmesh when player leaves trigger 0 Answers
Animation/Movement Error 1 Answer
What reason could there be, if a parent object refuses to take the new given position? 0 Answers
Unity animation is adding some odd curves/movement to the object 0 Answers