Demigiant / dotween

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

NullReferenceException: Object reference not set to an instance of an object #544

Closed kamiyargit closed 2 years ago

kamiyargit commented 2 years ago

can you pls help me with this? I can't work anymore!

NullReferenceException: Object reference not set to an instance of an object
DG.Tweening.TweenExtensions.IsPlaying (DG.Tweening.Tween t) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/TweenExtensions.cs:578)
DG.DOTweenEditor.DOTweenPreviewManager.PreviewGUI (DG.Tweening.DOTweenAnimation src) (at Assets/Plugins/Demigiant/DOTweenPro/Editor/DOTweenPreviewManager.cs:98)
DG.DOTweenEditor.DOTweenAnimationInspector.OnInspectorGUI () (at Assets/Plugins/Demigiant/DOTweenPro/Editor/DOTweenAnimationInspector.cs:292)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <2758fd44916644e3a3b65c9d4809b7f9>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Demigiant commented 2 years ago

Ahoy,

I can't understand why you would get that error, can you tell me when exactly this happens, and on what Unity version?

kamiyargit commented 2 years ago

Hi @Demigiant, thanks for the answer!

I added the DOTween component and hit the play all animations (just for testing!) and UI was got ugly and after I clicked the Stop animations. got this error every time. make sense?

by the way, I reinstalled and import the package and the problem was solved!

Demigiant commented 2 years ago

Ouch, I just managed to fix it. I made a silly mistake where, if you press the "play/all" button in the preview but there's no DOTweenAnimation set (meaning an empty DOTweenAnimation), it will cause errors. Will push it in the next update, apologies