I have derived a class from TArray to add some functionality.

But my derived class doesn’t work with delegates.
TArray is not a UCLASS and it works.

I don’t understand it. Why does this happen?
Thank you so much
I have derived a class from TArray to add some functionality.

But my derived class doesn’t work with delegates.
TArray is not a UCLASS and it works.

I don’t understand it. Why does this happen?
Thank you so much
A lot of code in the engine exists that specifically handles TArray’s to make them supported even if they aren’t marked UCLASS/USTRUCT. UnrealHeaderTool complains since your FScoreCardDataArray isn’t marked as UCLASS/USTRUCT. Even if you do, UHT may then complain that TArray isn’t allowed as a base.
Depends on your use case but I’d probably drop the class entirely and use TArray directly. You can write a free static function in a BlueprintFunctionLibrary that internally uses TArray::IndexOfByPredicate instead to find an element by PlayerID.
Ok, I will do it as you say since there is no other alternative.
Thank you very much for your help
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.