Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | anonymous |
In Unity I can do this:
SomeScript s = someObject.GetComponent<SomeScript> ();
What is the equivalent in Godot? I’ve tried
SomeScript s = someObject.GetScript() as SomeScript;
But this doesn’t work. GetScript()
returns a Reference
which I’m not sure what to do with. I just want to get the script attached to another node which I have a reference to.