I’ve noticed that there wasn’t a “Add
component by class” node so I couldn’t
add the component. I’ve realized that
loading components may require c++
which I will learn some point in the
future.
This is one of the major omissions in blueprints. And apart from some very inflexible hacks there’s little that can be done here, that’s afaik. I believe the last time I had to deal with something like this in BPs, I had each actor hold an additional array of struct:
- enum: component class (so not a class but an enumerator since class is almost useless as you’ve pointed out)
- bool: exists
- bool: should exist
I’d then read the components’ state before saving. When restoring the actor to its saved state, I’d switch on enum and check the bools:
- if the component exist but it should not, destroy it
- if the component exists and it should, do nothing
- of the component does not exist but should, add a component based on the switch (that’s where the inflexibility of this solution comes from)
Sorry.