TArray<AParticipant*> participants;
Hi Guys! I’m trying to create an array of objects but I don’t know what is wrong, can you help me?
It’s an array composed of Actors. I have this class “Participant”, it’s an actor and when I create this, i got errors:
UPROPERTY(BluprintReadOnly, EditAnywhere, Category = "Points")
TArray<AParticipant> participants;
Can you guys help me?
Still says that AParticipant identifier is not defined.
Thanks so much!
If you include AParticipant in cpp, then in .h file before your class add class AParticipant:
class AParticipant;
class PRO_API AMyActor : public AActor
{
GENERATED_BODY()
private:
TArray<AParticipant*> participants;
}
Or just:
TArray<class AParticipant*> participants;