I want to equip every (non-actor) static mesh with an identifier that is persistent across instances of the game. My first idea was to create a child class of AStaticMeshActor with an FGuid, but how would I automatically create an instance of this new class when dropping a mesh into the world?
Is this the wrong approach altogether? How could I achieve this?
Every actor dropped into the world is already assigned a unique identifier (in relation to its outer). You can access it with GetFName()
Actors also have a GUID created for them, but they are only available in editor builds. You can get it using GetActorGuid().
If you want to save a field every time you drag and drop something into the world, I think you’re going to have to modify the engine source code. You could easily modify the constructor in StaticMeshComponent.cpp.