-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check if property exists before tweening #81525
Conversation
I think adding a check with a better error message is good, but I'm a bit cautious about adding behavior that changes between debug and release builds. Could we do this check in both debug and release builds? It seems like a useful thing to do and it doesn't seem to be too heavy from performance perspective, either. And people often have to debug release build error logs too, so it also helps there. |
The behavior is the same (unless your final value is null for some reason...), only the error message is different. But indeed the check is cheap, so maybe it can be in release too, idk. The only time when it's relevant is when a) you don't test your project (this error is easy to catch) b) do some unsafe stuff with |
The variable should not be named |
It's property value xd |
I'd suggest using |
83fc1a5
to
bf9d971
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine like that, and we can always change it if someone signals that they need this check in production builds as well.
Thanks! |
When you try to tween a non-existent property, you get a confusing message about type mismatch between "nil" and target value type.
This PR adds a debug check whether a property exists, to print a clearer error.