Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | ComLarsic |
I have a node with a gdscript, and one with a C# script.
In the gdscript one i have a function made that i need to call in the C# script.
Normally when i call a function in a different node i would go:
NodeClassName Node;
public override void _Ready()
{
Node = GetNode<NodeClassName>("NodeName");
Node.Function();
}
however in gdscript there are no classes (at least not like in C#)
how would i call a function in a gsdcript node?
ok , i figured it out.
just like Blazeowsky said, you can call a function using:
Node.Call("function", "parameters");
But i found out that if you want the return value you need to cast it like so:
string funcResult = (string)Node.Call("function", "parameters);
ComLarsic | 2020-04-28 11:23