Demigiant / dotween

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

Should throw some sort of error is RectTransform is null when trying to tween #401

Closed pippinmole closed 4 years ago

pippinmole commented 4 years ago

this.RectTransform.DOLocalMove(position, positionDuration);

if RectTransform is null, it won't log anything :( Just spend about 5 hours trying to debug this error.

Demigiant commented 4 years ago

Ahoy!

That is what DOTween's safe mode is about: capturing these errors and killing the tween instead of stopping because of errors. Buuut, in the Preferences you can set the log behaviour to Verbose or Default instead of Errors-Only, which will throw a warning when things like this happen.

As a secondary note, RectTransform have a different coordinates system than world objects, so you should use DOAnchorPos (which uses the same X/Y coordinates you see in the RectTransform's Inspector) instead of DOLocalMove.