Godot C# get/set variable in another script attached to another object

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

In Godot 3.5.1 and C# from a script “SA.cs” attached to an object OA, I wish get/set a string variable U that lays in another script “SB.cs” attached to another object OB. Both object OA and OB are attached to the same Spatial Node. Can someone tell me how to code this? (- other examples out there are not working for me or missing details). Many thanks.

:bust_in_silhouette: Reply From: bancroftg

Have you tried using Scene Unique Name? (To be honest, I haven’t tried this with C#, just GDScript.)

Simplify Code with Scene Unique Name