Demigiant / dotween

A Unity C# animation engine. HOTween v2
http://dotween.demigiant.com
Other
2.34k stars 351 forks source link

NaN Input Error #680

Open seoyeon01 opened 5 months ago

seoyeon01 commented 5 months ago

Unity 22.3.13f1

transform.localPosition assign attempt for 'TestObject' is not valid. Input localPosition is { 0.000000, NaN, 0.000000 }.

image

I'm having a similar problem with this. https://github.com/Demigiant/dotween/issues/137

In my case, an error occurs in DOLocalMoveY. When I Debug.Log the value of the Input Value, it seems that there is no problem. However, in DOLocalMoveY, the value of Y is Nan, which causes the problem.

What should I check?

Decavoid commented 5 months ago

Show code that calls DOLocalMoveY. NaN is usually produced when you divide any number by 0.

seoyeon01 commented 5 months ago

Oh, I think I found the cause of the problem. Of course it's my fault, but I think there's room for improvement

Sequence.Insert(insertTime, target.DoLocalMoveY(...)); I'm using this way. The problem is that the value of Y is normal, but the insertTime is NaN. However, DoTween's Log say that the value of Y is Nan! So there was confusion in my search for the cause of it.