I am attempting to move a child node (RichText) inside of a Kinematic Body 2D, but I can't find a way to get the global position of the child node.
Assuming TitleText is the node name, try this: onready var title_text_position = $TitleText.global_position
onready var title_text_position = $TitleText.global_position
You have to get the node first, by using get_node, then get it's position. The error message is telling you that function doesn't take any arguments, which is why it doesn't work when you pass it a string.
I tried both of your solutions but it keeps saying "Invalid get index 'global_position' (on base: 'Rich Text Label')"
My previous post was incorrect. Use this instead (since RichTextLabel inherits from Control, not from Node2D): onready var title_text_position = $TitleText.rect_global_position
onready var title_text_position = $TitleText.rect_global_position
It works now tysm
Also, if you get an error like "Invalid get index 'global_position' (on base: 'Rich Text Label')", that means the property you are trying to call is not in the API. Meaning you either misspelled it or that the name is something different. You can check the API by pressing F1 on the keyboard and searching for the class "RichTextLabel" and then you can check what methods and properties are available.