touilleMan / godot-python

Python support for Godot 🐍🐍🐍
Other
1.83k stars 136 forks source link

How to call a Python function from C#? #357

Closed vrmaurice closed 1 year ago

vrmaurice commented 1 year ago

Hello How can i call a Python function from C#?

For example:

Python:

from godot import *

@exposed
class TestClass(Node):
    def foo(self, param1):
        print(f"Called 'foo'! param1: {param1}")

How can i call foo from my C# script? Just using Call doesn't work.

vrmaurice commented 1 year ago

Turns out it did work lol