Does Godot have a built-in function for registering the translated position of a mouse click within a child scene?
Here's the sample code for a simulation where you can pick up and throw objects about. (It includes emitting signals to my "world" scene for delegation.)
var held = false
var local_offset = Vector2.ZERO
var rotated_offset = Vector2.ZERO
func _input_event(viewport, event, shape_idx):
local_offset = get_local_mouse_position()
rotated_offset = rotate(local_offset)
var x2 = cos(rotation)*coords.x - sin(rotation)*coords.y
var y2 = sin(rotation)*coords.x + cos(rotation)*coords.y
With the rotate function, it translates the click position relative to the rotation of the child node, so the pickup doesn't shift the center of the object to the mouse click.
Didn't know if there was a Godot built-in one-liner for this sort of transformation.