What's the simplest way to set variables of instanced scenes?

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

If i have an enemy in a 2d platformer where each instance needs variables that are set individually at the beginning of a level, what is the simplest way to do this? I can think of a few not great ways, just looking for one that’s a little cleaner. Currently I’m just making enemies children of another node and adding a script to that node that sets the variables, but I’m planning on making a lot of levels and would rather not have that many scripts.

:bust_in_silhouette: Reply From: Socrates

Okay found it. Just use the export keyword in front of variables and it shows them in the inspector. Don’t know how I didn’t know that before.