Download

Function of derived SceneComponent not accessible

I’m migrating stuff from Blueprint to C++. From the code below, when I get the children SceneComponent from the HitComp, there would be only one derived SceneComponent which has the RegisterFrictionPoint function declared. So for the other SceneComponent it is an undeclared function.


/* Pawn Event Functions */
void AComputerVisionPawn::OnGroundContact(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
    if (Hit.bBlockingHit)
    {
        TArray<USceneComponent*> StaticComps;
        ResetFrictionPoints();
        HitComp->GetChildrenComponents(true, StaticComps);
        for (USceneComponent* FrictionComp : StaticComps)
        {
            FrictionComp->RegisterFrictionPoint(. . .);
        }        
    }
}


I only need to get the children which are from the derived class such as:
(


class FRICTION_API UFrictionComponent : public USceneComponent

)

I tried modifying the SceneComponent.h and *.cpp in order to later overloading the RegisterFrictionPoint but that didn’t seemed to work very well.