Get reference to specific component on blueprint for use in actor component

Hello!

In Unity, I can have a component that has an exposed variable, and I can assign, for example, a collider of my choosing by dragging it into the exposed slot, thereby getting a reference to the exact collider I want to perform logic on in my component.

Here in Unreal, I have an actor component that needs to know which collider (e.g. static mesh, box collision) to perform logic on. I have exposed a variable for this purpose called “Collider”, but I am unable to drag anything from the blueprint onto it. I am also unable to select anything from the dropdown.

Again, I need to be able to select which component is referenced, as there could of course be multiple static mesh components on one blueprint. If this is not possible, which it seems like it isn’t, I would love to hear the next best alternative to what I’m looking for. Someone elsewhere suggested that I have a property to input the exact name of the component I want to grab, and then find the component that way, but this is certainly not ideal.

Let me know your thoughts! This is a bit frustrating coming from how ridiculously easy it was to achieve the same behavior in Unity.

Best,

Lorenzo

1 Like

Hey, when you create the variable give it a name like Collider Ref
Then click the type and when the pop window appears you need to search for your object type or default class like staticmesh object reference then select the eye like you did. Then you will be able to drag or select any object of that type.

Thanks for the reply. Unfortunately, this does not work, as there are zero results always regardless of what I type. To clarify, I am needing all of this to work within a blueprint, not with objects that are already in the scene.

Hey did you find a good way of solving this problem? I also came from Unity and I’m having the same frustration.

I come from Unity as well. The best I’ve come up with so far is to assign the variable in the construction script of the blueprint.

Just wanted to bump this to see if anyone had any new ideas? It seems like a simple problem when dealing with an actor that may have many colliders attached to it. In my particular case, I am trying to assign a specific collider from an ActorComponent that is attached to the Actor so that I can turn the collision on and off, which feels like it might be impossible in Unreal Architecture land.