So I’m able to get all the UStaticMeshComponents in the world with SphereOverlapComponents, but for the life of me I cant figure out why its not returning any UCapsuleComponents.
Heres my call to SphereOverlapComponents
TArray<TEnumAsByte<EObjectTypeQuery>> objectTypes;
TArray<AActor*> actorsToIgnore;
TArray<UPrimitiveComponent*> outComponents;
bool result = UKismetSystemLibrary::SphereOverlapComponents(GetWorld(), hand->GetComponentLocation(), GrabDistance, objectTypes, nullptr, actorsToIgnore, outComponents);
and heres my class for UCapsuleComponent
UCLASS()
class WUT_API UCableGrabSegmentComponent : public UCapsuleComponent, public IGrabbable
{
GENERATED_BODY()
public:
UCableGrabSegmentComponent();
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Grabbable")
bool GrabStart(class UPrimitiveComponent* hand);//Return false if object doesnt want grabbed
virtual bool GrabStart_Implementation(class UPrimitiveComponent* hand) override;
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Grabbable")
bool GrabEnd(class UPrimitiveComponent* hand);
virtual bool GrabEnd_Implementation(class UPrimitiveComponent* hand) override;
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Grabbable")
bool GrabEvent(class UPrimitiveComponent* hand, bool buttonPressed, float upDown, float leftRight);
virtual bool GrabEvent_Implementation(class UPrimitiveComponent* hand, bool buttonPressed, float xAxis, float yAxis) override;
};
UCableGrabSegmentComponent::UCableGrabSegmentComponent() {
SetGenerateOverlapEvents(true);
SetCollisionObjectType(ECollisionChannel::ECC_PhysicsBody);
SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Overlap);
SetCollisionEnabled(ECollisionEnabled::QueryOnly);
InitCapsuleSize(1.0f, 1.0f);
}
Is there anything I’m missing for the UCapsuleComponent (aka UCableGrabSegmentComponent) to be able to be detected by SphereOverlapComponents?