I was attempting to use the usual method of attaching a component to the root object in my class but the UPhysicsThrusterComponent is no longer accessible via normal pointers. I get the error pointer to incomplete class type is not allowed. I then tried to forward declare and that also didn’t work. I looked up the source code and found this:
I tried the suggested “please use GetThrusterComponent() function instead” and still get the error, so how do I attach a thruster to the vehicle I am building?
Here’s my code:
//header file
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Moto")
class UPhysicsThrusterComponent* Thruster;
//source file
Thruster = CreateDefaultSubobject<UPhysicsThrusterComponent>(TEXT(""));
// NO WORKIE
Thruster->AttachTo(Moto);
// ASLO NO WORKIE
Thruster->GetThrusterComponent();
//WHAT DO I DO NOW?????