Skip to content

When an ongoing tween is happening while an object is destroyed, an error is logged - with no way to disable? #70

Answered by KyryloKuzyk
coty-crg asked this question in General
Discussion options

You must be logged in to vote

It is safe to destroy objects with running tweens, and there is no need to Stop() tweens manually before destroying an object or unloading a scene. Here is a separate article on this topic: #4

The error you get appears when you pass null (or destroyed) target to Tween.UISizeDelta() method. So to "disable" the error you need to check whether RectTransform != null. Or better: understand why RectTransform is null because this error typically indicates a bug in the user's code.

If you get this error only when you destroy your UI panel, I assume you're trying to start an animation when the RectTransform has already been destroyed. A full stack trace can help understand what's happening exactly.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by KyryloKuzyk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #69 on April 17, 2024 06:08.