How to pass an actor class type parameter to a function?

Hello community,

I am wondering how I can pass a class reference of type “AActor” to a function as an input parameter?

I did this with blueprints without any problems, but I am having troubles with the C++ syntacts. This is how it should look like:

56654-unreal+engine+4_+problem+actorref.png

But for now I only managed to get a Object Reference… and It looks like this:

56656-unreal+engine+4_+problem+actorref+2.png

But I do not want an obj ref I want an actor class ref. How do I do that? My code right now looks like this:

void AActorUtilitiesCode::GetClosestOverlappingActor(const UClass* ActorClass, 

The second problem I have with the standard “CollisionComponent->GetOverlappingActors” function is, that when ever I pass a filter parameter to the function in this case “ActorClass” (filled with an actor ref) the function won’t return anything, although all objects in my scene are inherited from Actor. I am not getting any errors too so I wonder whats going on? :smiley:

Thanks for you help in advance!

Greets,

Linus

in a blueprint, when you assign the function’s input type Actor then look on the rollout where you can choose Class or Reference or whatnot.

I added this answer just if someone else comes across it because it also stumped me for a while.

68589-2015-11-29+18_07_09-.png

omgwow. I feel like such an idiot, you wouldn’t believe how long I’ve been looking for this.