I am creating Pipes Generating tool based on USplineComponent. For that I have to set the USplineComponent as the Root Component of my Actor based GenPipe class. I have tried this:
//GenPipe.cpp
AGenPipe::AGenPipe() //..The Constuctor
{
splineComponent = CreateDefaultSubobject<USplineComponent>(TEXT("Spline Component"));
RootComponent = splineComponent; //..Problematic Assignment
}
The splineComponent is declared in like this:
//somewhere in GenPipe.h
private:
class USplineComponent* splineComponent;
But when I compile, It gives me compilation error:
//Error after compilation
error C2440: '=': cannot convert from 'USplineComponent *' to 'USceneComponent * '
note:Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast.
Any help will be appreciated.