How do you setget a built-in inspector variable like Pos.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By JTJonny
:warning: Old Version Published before Godot 3 was released.

I’m trying to trigger a tool script when a node is moved in the editor.

:bust_in_silhouette: Reply From: rredesigns

Use get(“PropertyPath”). For instance Node2D.get(“transform/rotation”).

If you hover your mouse on any property in the inspector you should get a tooltip that says exactly the name / path of that particular property.

Thanks for the info!

This is the code I used if anyone needs an example:

func _notification(what):
	if is_inside_tree() and get_tree().is_editor_hint():
		# this notifies you when the Node is moving
		if what == NOTIFICATION_TRANSFORM_CHANGED: 
			update_chain = true

func _get(property): 
	property 
	if property == "transform/pos":
		update_reel_and_goal_based_on_edit_button_pos()

JTJonny | 2017-07-12 00:32