Where is ActorComponentClass in blueprint type library?

Unreal 4.5.1

Figured I’d implement a GetComponentByClass helper function to safely extract first and only component from array returned by GetComponentsByClass rather than having to do this manually every time. Components which are single instance per actor is most common component pattern and it’s surprising that this node is not included out of box. Anyway, this proved to be more difficult that you might think…

So problem is that in my function I can’t specify that an input is of type ActorComponentClass. Inexplicably, this type does not appear in list of types.

I managed to work around this problem in a blueprint by dragging off ComponentClass pin of GetActorComponentsByClass, promoting to a variable and then collapsing my nodes to a function. When I do this editor is able to resolve input to correct type and everything is great. Proof positive that it can work in principle.

Sadly, this trick does not work in a function library since there is no context for promoting a pin to a variable. So I am left having to copy paste copy paste copy paste copy paste copy paste copy paste copy paste copy paste copy etc.

Maybe time I bite bullet and implement this function/node in C++.

Hi ioJoss,

When I create a function and use a GetComponentsByClass node, ComponentClass input has a dropdown option for Actor Component. Are you looking for something else, or is that not showing up for you? Which version of engine are you currently using?

Hey ioJoss,

We haven’t heard back from you in a while, so I am marking this post resolved for tracking purposes. If you are still unable to find Actor Component in GetComponentsByClass node dropdown, please let us which engine version you are using and we will continue investigating. Thanks!

Hi ,

Sorry - haven’t been keeping up with my questions/bugs.

I think you misunderstand. I can of course see ActorComponent in drop down. Presumably this will return all components regardless of type, which is an unusual use case.

What I was talking about is passing class type into GetComponentsByClass through an ActorComponentClass class reference. Outside node, I would be able to pass in class for any object based on ActorComponent and so would be able to reuse node for different classes.

At this point it might be helpful if you re-read my original question (in which you can also find Engine version clearly stated at top!).

Additionally you could try to make a GetFirstComponentByClass function in an actor Blueprint and you will inevitably hit same limitation.

FYI, I worked around this issue by adding node I needed in C++. This was trivial as GetComponentByClass exists and just needed to be wrapped in a function tagged with BlueprintCallable.

Thanks,