How to exactly position a Light2D when influenced by Camera2d with smoothing on

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By CopyConstructor

First, I’m a beginner in Godot and Game dev.

My Q: In Godot I’m using a Light2D following the player (acting as a kind of main light). The root of the scene “player” is a KinematicBody2d and the Light2D and Camera2d are child nodes. For the camera smoothing is enabled. As explained within the Godot documentation, I can use get_camera_screen_center() to get the real position of the camera. I thought something as simple as
light.position = $"Camera".get_camera_position()
would position the texture of the Light2D right. But now, the top/left corner of the light texture is somewhere in the bottom/right corner of the screen. What do I miss? How to calculate the offset to use? ( I tried half of the view port size but this is still incorrect.)

I would most like to have a signal emitted from the Light2D (with the real position) every time the real (smoothed) position is changing. But this seems not to be not implemented.

:bust_in_silhouette: Reply From: CopyConstructor

I needed to set the global position of the light because the position is relative to the parent node.

$Light2D.global_position = $Camera2D.get_camera_screen_center()