I ran into an issue using a scale animation on an object with a rigidbody. This problem happens with both LeanTween and iTween. The animation runs every second for a third of a second, and while the rigidbody is moving under the force of gravity the motion seems to halt during the animation.
Add the following script to a Sprite, add a Rigidbody2D, set Interpolate on the Rigidbody to "interpolate", and set the gravity to 0.2 for easier viewing:
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class TestLeanTween : MonoBehaviour {
void Start () {
StartCoroutine(this.Grow());
}
private IEnumerator Grow() {
float scale = 0.2f;
while (true) {
yield return new WaitForSeconds(0.7f);
scale += 0.1f;
LeanTween.scale (this.gameObject, new Vector3(scale, scale, 1), 0.3f);
}
}
}
Place the Sprite on the screen up at the top and start the game. As the object falls, the downward motion will repeatedly pause while the scaling animation is active. If interpolate is set to "extrapolate", the sprite will fall faster during the scaling animation.
Any ideas what might be causing this behavior?