How to use GetOverlappingActors with classfilter?

Use ABatteryPickup::StaticClass instead

Hello :slight_smile:

I want to use the function
void AActor::GetOverlappingActors(TArray& OverlappingActors, UClass* ClassFilter) const
docu found here:

I am doing the tutorial
Introduction to UE4 Programming - 5 - Empowering the Character
and i want to use the getoverlappingactors with a classfilter.

I try to call the getOverlappingActors with a classfilter:
CollectionSphere->GetOverlappingActors(CollectedActors, ABatteryPickup::GetClass);

but i get the error:
error C3867: ‘UObjectBase::GetClass’: function call missing argument list; use ‘&UObjectBase::GetClass’ to create a pointer to member
and i dont know how to solve it :slight_smile:

In the tutorial every overlapping actor is collected and then casted to Cast(…)
and then checked. This works but i thought that it would be more elegant to specify the classfilter in getoverlappingactors.

Thanks in advance for your help :slight_smile:
danbo

If anyone by chance come to this as well, this is actually a method, so it should be ABatteryPickup::StaticClass().
This might be obvious for some people, it just wasn’t to me and I had some trouble