Set variable to c# script through editor

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Hralok

I’m looking for a way to set a variable in a c# script via the editor. Is it possible? Simple [Export] working only with scripts, attached to Node, but I want to set variable in script, that can’t be attached to Node. In Unity, as i remember, [SerializeField] do this work, but I can’t find something like that in Godot. Help plz!

:bust_in_silhouette: Reply From: spaceyjase

[Export] is the way here although you need to describe the class/type to godot, which can be done via a Resource (which is similar to a Unity’s ScriptableObject).

There’s a great tutorial in the docs; Resources — Godot Engine (stable) documentation in English