# how to make property filter?

**URL:** <https://forums.unrealengine.com/t/how-to-make-property-filter/2270075>\
**Category:** C++\
**Tags:** unreal-engine, question\
**Created:** [January 10, 2025, 7:15pm UTC](https://forums.unrealengine.com/t/how-to-make-property-filter/2270075 "2025-01-10T19:15:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JulioJerez](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JulioJerez](https://forums.unrealengine.com/u/JulioJerez)\
**Post date:** [January 10, 2025, 7:15pm UTC](https://forums.unrealengine.com/t/how-to-make-property-filter/2270075/1 "2025-01-10T19:15:50Z")

</div>

I have this class

```auto
UCLASS(ClassGroup=(NewtonJoints), meta=(BlueprintSpawnableComponent))
class UNewtonJointFix : public UNewtonJoint
{
	GENERATED_BODY()
	
	public:
	// Sets default values for this component's properties
	UNewtonJointFix();

	virtual void DrawGizmo(float timestep) const override;
	virtual ndJointBilateralConstraint* CreateJoint() override;

	UPROPERTY(EditInstanceOnly, Category = Newton)
	TObjectPtr<UNewtonRigidBody> RefRigidBody;

	UPROPERTY(EditInstanceOnly, Category = Newton)
	TObjectPtr<USceneComponent> RefRigidComp;

	UPROPERTY(EditInstanceOnly, Category = Newton)
	TObjectPtr<AActor> RefSceneActor;
};

```

The only properties is RefRigidBody  
but I added the other tow properties to illustrate the problem.  
This is how the detail panel looks like

 ![Untitled](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/9/6/a9627a300370e329346c7346c466e0e436503200.png)

As we can see , for the actor properties,  
Unreal automatically generates and set of the objects that can be selected.  
It seems this functionality is single out only for actors.

The question is how can I add that functionality for a custom set of available components?

---

<div class="post-metadata">

**Author:** ![SolidGasStudios](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/solidgasstudios/32/1194575_2.png) [@SolidGasStudios](https://forums.unrealengine.com/u/SolidGasStudios)\
**Post date:** [January 11, 2025, 12:01pm UTC](https://forums.unrealengine.com/t/how-to-make-property-filter/2270075/2 "2025-01-11T12:01:04Z")

</div>

This might be what you are looking for:

```auto
UPROPERTY(meta=(AllowedTypes="abc"))

```

[https://benui.ca/unreal/uproperty/](https://benui.ca/unreal/uproperty/)

---

<div class="post-metadata">

**Author:** ![JulioJerez](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JulioJerez](https://forums.unrealengine.com/u/JulioJerez)\
**Post date:** [January 16, 2025, 4:41pm UTC](https://forums.unrealengine.com/t/how-to-make-property-filter/2270075/3 "2025-01-16T16:41:41Z")

</div>

I tried. but not that does not really works.

It seem that he ureal team decide that when the make the Detail panel widged, they single out some classes, like actors, and almost every asset (texture, static mesh, materials, etc)  
and gave them special sub sear menus menus.  
but for some reason they excluded Actor components.

as it stand now they is to was to initialize an actor component pointer form the editor, whether it was a blueprint of the scene.  
It seems the only was to do that is but a blue print, of by giving a default.

Thanks anyway.

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [January 17, 2025, 12:50am UTC](https://forums.unrealengine.com/t/how-to-make-property-filter/2270075/4 "2025-01-17T00:50:51Z")

</div>

do you mean like  
TSubClassOf\<\>

or do you mean to choose from a list like

```auto
UPROPERTY(meta=(GetOptions="abc"))

```

---

<div class="post-metadata">

**Author:** ![JulioJerez](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JulioJerez](https://forums.unrealengine.com/u/JulioJerez)\
**Post date:** [January 17, 2025, 3:54pm UTC](https://forums.unrealengine.com/t/how-to-make-property-filter/2270075/5 "2025-01-17T15:54:26Z")

</div>

It is quite simple.

Suppose you are making a custom component class for your project.  
you need to get a hold of a another UObject so you add a Property. something like

```auto
UPROPERTY(EditAnywhere, ....)
TObjectPtr<SomeClass> myVariable;

```

if is happens that SomeClass is derived from AActor, UTextute, UStaticMesh, UMaterial, and few others. Then, when in editor or game, the detail panel gives the user browsing capability.  
However if SomeClass is subclass of Actor Component, you only get a dropdown list with an empty selection.  
No where is the code or documentation explain how to populate the drop down list.

this is not because the subclass of a static asset because actors aren’t.  
what this mean is that if you add a pointer to a component in one of your classes,  
the only way to initialized it is either by setting a default value at construction,  
or by writing a blueprint script that uses a function to set it.

I can see why is this. In other to provide this functionality the compound widget most be written to support the functionality for that class. I actually wrote an asset editor and found that out.  
However the standard unreal editors are inflexible.  
and it appears that the designers of this editors explicitly excluded components from browsing.

---

<div class="post-metadata">

**Author:** ![Lustwaltz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lustwaltz](https://forums.unrealengine.com/u/Lustwaltz)\
**Post date:** [March 1, 2025, 8:27pm UTC](https://forums.unrealengine.com/t/how-to-make-property-filter/2270075/6 "2025-03-01T20:27:43Z")

</div>

Because of the way Components work in spawning and owning, they are trickier than most other objects in the game world to hold a reference to.

For Actor Components, you can use `FComponentReference` or `FSoftComponentReference`, with `UseComponentPicker` to have a drop-down instead of a FName field, `AllowedClasses` to filter classes, and `AllowAnyActor` to include other actors in the world. Note that in Blueprint Editor you can only fill in the FName with the name of the component. The drop-down picker will be empty.

```auto
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(UseComponentPicker, AllowedClasses="/Script/MyProject.MyClass", AllowAnyActor))
FComponentReference MyComponentReference

```
