Instanced Sibling stares (look_at()) at another Instanced Sibling How?

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

I have two instanced scenes (A and B as children of Main Scene), now A is instanced in the Editor while B is instanced in the Script of Main. In the Script of B, I want to add behavior for it to look at A. Without adding code in the Main scene, how can I implement this if it is possible?

(No signals if possible, A and B are instanced siblings, and they are both kinematic bodies)
GDScript is nice but if it is in C# it will be more helpful, thanks!

:bust_in_silhouette: Reply From: juppi

What about that script for Node B:

Spatial a = GetNode<Spatial>("../A");
LookAt(a.GlobalTransform.origin, Vector3.Up);

“…/” will get the parent node, and “A” will get it’s child.