Line 1: This script is attached to a Camera3D node. It inherits camera behaviour and properties (so this node becomes the camera).
Line 3: speed is an exported variable (you can change it in the editor). It controls how quickly the camera moves toward the target transform — larger = faster catch up.
Line 6: Calculate an interpolation factor: multiply the frame time by speed.
clamp(..., 0.0, 1.0) ensures the value stays between 0 and 1.
weight = 0 means “no change”, weight = 1 means “jump straight to the target”. Typical values are somewhere in between, producing smoothing.
Example: if delta = 0.016 (≈60 FPS) and speed = 44, weight ≈ 0.7.
Line 8: This blends (interpolates) the camera’s current global transform toward the parent node’s global transform by the fraction weight.
It mixes position + rotation + scale between the camera and the parent.
weight = 0 → no change, weight = 1 → set exactly to parent.
Result: the camera’s transform moves partway toward the parent this frame (smoothing effect).