Pass arguments to custom node

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Marteon27
:warning: Old Version Published before Godot 3 was released.

Hello.
I have created a custom node via editor plugin.
This node has a var speed. Is there any way to set this variable?
Thanks for help.

from editor or runtime?

volzhs | 2017-06-30 14:10

:bust_in_silhouette: Reply From: Zylann

You can set this variable just as any variable in a node script (doesn’t matter if it’s with a plugin or in the game). Get the node, and do myNode.speed = x for example.
If you want to set the variable from the editor, use the export keyword.

Oh my god, I feel so stupid right now. The export keyword was exactly what I needed! Thank you!

Marteon27 | 2017-07-01 17:17