-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Add :
to node properties, to differentiate them from node paths
#93890
Conversation
:
to node properties, to differentiate them from node paths
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.
Approved already in RocketChat... chat.
As seen by the issue above, It's really worth paying attention to this when both "node" and "property path" matter.
I reiterate briefly for future reference: for some methods (Object.get_indexed()
, Tween.tween_property()
, etc.), the :
prefix can be optionally omitted. This is because these methods only expect their given NodePath to refer to a property, and use get_as_property_path()
internally to ensure it does.
Although Godot users are pretty much used to it (it's really nice), this should be seen as an exception, and ideally should be briefly stated for each method that does this.
If one form is preferred (and it sounds like including the leading |
1b574c4
to
54d6c9e
Compare
Thank you for the review ! |
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.
Thanks, that sounds great to me!
Thanks! |
Fixes #93844
It seems that adding a
:
before a property is mandatory in some cases, and optional in others. So this PR adds it to the doc in order to cover most cases.An example where this is mandatory is in the
MultiplayerSynchronizer.replication_config.add_property
(see issue #93844)On the other hand, the
:
is optional inObject.get_indexed()
andTween.tween_property()
E.g: those 2 lines yield the same result