Is this a bug in the UPROPERTIES?

Hey everyone,

I’m working on a plugin that involves a physical material variable the user can set. Odd thing though: the code can’t compile when the physical material is a UPROPERTY. it can compile when it isn’t though. Why is that? Is it a bug? are there other data types that can’t be UPROPERTIES?

UPROPERTY(EditAnywhere, Category = "Default")
UPhysicalMaterial* MatFilter = nullptr;

I’ve just tested it, and it compiled just fine.
What does the compilation error read?

Heyo, this is working for me as well, just make sure you include “PhysicsCore” as a dependency module in your plugin build.cs file.

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "PhysicsCore" });

Let me know if this works, and as recommended above you can share the output log with us.

You need to forward-declare it. The compiler doesn’t know what UPhysicalMaterial is when it reaches that file.

I have the include file in there, and it works if I remove UPROPERTY