0 votes

There is a way to load external scripts and attach them to nodes?

in Engine by (695 points)

1 Answer

+1 vote
Best answer

Hey JulloYagaml,
You can set a nodes script with

$Node.set_script(load("path/to/my/script.gd"))

As you can see from this, paths can be global as well as local.

You can also easyly copy files into your game using the Directory class.

Hope I was able to help.

by (864 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.