Creating resource instances for different enemies with the same properties

Godot Version



I created a resource for the enemies that exports variables such as health, speed and damage. The thing is that I’ll be using the same enemy during different moments of the scene, that is, there are multiple instances of the same enemy. With that in mind, would I need to create a resource instance for every single one? If that’s the case, would it be better to keep variables like health inside the enemies’ script instead of the resource, as these variables are unique to the instance?

You create one resource per unit-type (most easily done via the editor) and instantiate that multiple times (most easily done via code).
An individual unit-type despite (theoretically) starting off with a set amount of health will still own his own health amount that can subsequently vary among instances of the same unit-type.
In other words those variables will be unique to each instance.
It sounds like you are off to a correct start.