When trying to declare a virtual function that returns a user-defined struct, I receive the error “Error C2575 ‘ReturnValidCoordinates’: only member functions and bases can be virtual”. Here is my code:
UCLASS()
class PROJECTORDER_API AParent_Piece : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AParent_Piece();
virtual TArray<FBoardCoordinate> ReturnValidCoordinates();
}
and in the cpp file:
virtual TArray<FBoardCoordinate> ReturnValidCoordinates()
{
TArray<FBoardCoordinate> Coordinates;
return Coordinates;
}
Does anyone know the cause of this?
Thanks in advance!