I’m trying to access my UCurveLinearColor class.
In .h I declared:
UPROPERTY( EditAnywhere, BlueprintReadOnly, Category = Default )
class UCurveLinearColor* SunLightColor;
UPROPERTY( EditAnywhere, BlueprintReadOnly, Category = Default )
class UCurveFloat* SunLightIntensity;
Then I tried to access in .cpp:
FLinearColor AManagerTimeOfDay::GetSunLightColor( float time )
{
return SunLightColor->GetLinearColorValue( time );
}
float AManagerTimeOfDay::GetSunLightIntensity( float time )
{
return SunLightIntensity->GetFloatValue( time );
}
It is possible to access SunLightIntensity with no issues, but if I try to return the sun color Visual Studio is mentioning the above error. What am I missing?
When writing class UCurveLinearColor SunLightColor;* in the .h you are forward declaring the UCurveLinearColor class.
If you want to use it in the .cpp file you must include the .h in which UCurveLinearColor is really defined, you are just missing a #include “Curves/CurveLinearColor.h” on top of your .cpp file
If some of your #include ends to #include “Curves/CurveFloat.h” somewhere in the include chain it will be inherited and already known as a side effect.