Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | siamak-s |
How we can define something like below:
func func_name() -> [A Custom Scene Class]:
... do sth ...
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | siamak-s |
How we can define something like below:
func func_name() -> [A Custom Scene Class]:
... do sth ...
Reply From: | Zylann |
Scenes are not classes. Scripts are. I would guess it would be this if your script has a class_name
:
func func_name() -> YourClass:
As shown here: Static typing in GDScript — Godot Engine (3.1) documentation in English
Yes! I add ‘class_name’ line on top of my scene’s script and then I could use it as a type.
siamak-s | 2019-08-21 14:08