You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, assume that I want to make a code like this in GDScript:
# my_gd_script.gd
extends Node
# Load the Python script
onready var python_script = preload("res://my_python_script.py")
func _ready():
# Call the Python function and get the return value
var result = python_script.add_numbers(5, 3)
print("The result is:", result) # Output: The result is: 8
The python script is just this:
# my_python_script.py
def add_numbers(a, b):
return a + b
And I know it's not working. But, is there an alternative way for this to work? Any help is appreciated. Thanks!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
So, assume that I want to make a code like this in GDScript:
The python script is just this:
And I know it's not working. But, is there an alternative way for this to work? Any help is appreciated. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions