I’m using dotween’s DoMoveY to float some texts. Here’s code I’m using
public void FloatText(Vector3 pos, int num, int type)
{
var obj = PoolManager.Instance.Get(floatingTextPoolKey);
obj.SetActive(true);
obj.transform.position = pos + (Vector3) Random.insideUnitCircle.normalized * .2f;
obj.GetComponent<TextMeshPro>().text = num.ToString();
obj.transform.DOMoveY(obj.transform.position.y + .1f, .2f).onComplete += (() => PoolManager.Instance.Pool(obj));
}
Problem is, sometimes DoMoveY’s OnComplete callback does not work(like 30% chance), even when the object has stopped moving. It just won’t work. I tried to change the Y value but it didn’t work either.
Unity version is 2020.3.5f1 and DOTween version is 1.2.632. Any help would be grateful. Thanks in advance.