Strange crash behavior - FComponentReference to a BlueprintSpawnable C++ Component

I’m pretty sure at this point I can call it a bug. If someone else could properly reproduce to give me confirmation before I make a report that would be awesome.

To replicate:

Create a class in C++ inheriting from SceneComponent. Give it these UCLASS() metas
BlueprintType, meta=(BlueprintSpawnableComponent)
Add a component picker with this meta. Specifically what’s going to crash here is the AllowedClasses meta.

UPROPERTY(EditInstanceOnly, BlueprintReadOnly, Category = "MyCategory", meta = (UseComponentPicker, AllowAnyActor, AllowedClasses = "THE_NAME_OF_THIS_COMPONENT_CLASS"))
FComponentReference PickComponent;

Now what you want to do is make a blueprint inheriting from actor (easiest) and add your c++ component to the class definition (not to an instance).

Add your BP to the world
Add a c++ actor to the world and add the component as an instance

Try to use the component picker on the BP to select the component instance on the c++ actor. You should recieve the same crash I have. Doing the opposite action (picking the component on the BP from the c++ actor components ComponentPicker) will not crash.

If you remove or change AllowedClasses meta to not include the class of the component you will not get this crash at all. It’s only when the class you are searching for is the class the FComponentReference is a member of.

I really want the filtering via AllowedClasses but for now I’m just not using it and forcing my team to search through all actors in the world.

1 Like