Hi, I’ve got a small problem. I have a component that references owner’s other SkeletalMeshComponents. It seems that the SkeletalMeshComponents get destroyed from time to time, and I wonder what are the best practices (or how can one handle this more or less cleanly) so that I always have usable SkeletalMeshComponents. The code is more or less:
class UMyComponent : public USceneComponent {
...
public:
UPROPERTY(EditAnywhere)
TArray<FString> TrackedComponentNames
protected:
UPROPERTY()
TArray<USkeletalMeshComponents*> TrackedComponents;
...
}
On TickComponent the TrackedComponents
arrays is recreated from TrackedComponentNames
, but I think this is somewhat inefficient. Is there a better way to do so?