Created
June 26, 2024 02:31
-
-
Save Shilo/eaf01c95f3625a91d2a9052347cdd8e6 to your computer and use it in GitHub Desktop.
Godot GDScript eval helper function.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func eval(code: String) -> Error: | |
var script := GDScript.new() | |
script.source_code = "static func _static_init(): pass; " + code.strip_edges().replace("\n", ";") | |
return script.reload() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment