Hi,
I can set references of other components in the editor as values of components, but when I modify the C++ code this changes get lost.
For instance:
class MY_API USwitchComponent : public UActorComponent
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = SwitchComponent)
USwitchableComponent* SwitchableComponent;
...
}
UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class MY_API USwitchableComponent : public UActorComponent
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Disturber)
TArray<USwitchComponent*> SwitchComponents;
}
I guess that the editor checks that there’s a new version of the component or actor, replaces them with the new version and tries to sets the values of the old version with the new version. Only happens when I change either the component itself or the actor that owns that component. It might fail since it’s a component referencing another component, but it works until I modify code of the owner actor or the components.
How can I solve this? Is there a walkaround? Does anybody know the exact piece of code where the editor does this?
Thanks,
FL