# Is this a bug in the UPROPERTIES?

**URL:** <https://forums.unrealengine.com/t/is-this-a-bug-in-the-uproperties/795957>\
**Category:** C++\
**Tags:** unreal-engine, CPP, question\
**Created:** [March 21, 2023, 8:30pm UTC](https://forums.unrealengine.com/t/is-this-a-bug-in-the-uproperties/795957 "2023-03-21T20:30:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dudebat923](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dudebat923/32/699029_2.png) [@dudebat923](https://forums.unrealengine.com/u/dudebat923)\
**Post date:** [March 21, 2023, 8:30pm UTC](https://forums.unrealengine.com/t/is-this-a-bug-in-the-uproperties/795957/1 "2023-03-21T20:30:26Z")

</div>

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?

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

```

---

<div class="post-metadata">

**Author:** ![Tuerer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tuerer/32/1008648_2.png) [@Tuerer](https://forums.unrealengine.com/u/Tuerer)\
**Post date:** [March 23, 2023, 9:24am UTC](https://forums.unrealengine.com/t/is-this-a-bug-in-the-uproperties/795957/2 "2023-03-23T09:24:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Raja.Haris](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/raja.haris/32/1191940_2.png) [@Raja.Haris](https://forums.unrealengine.com/u/Raja.Haris)\
**Post date:** [March 23, 2023, 11:07am UTC](https://forums.unrealengine.com/t/is-this-a-bug-in-the-uproperties/795957/3 "2023-03-23T11:07:00Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![dudebat923](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dudebat923/32/699029_2.png) [@dudebat923](https://forums.unrealengine.com/u/dudebat923)\
**Post date:** [March 23, 2023, 2:22pm UTC](https://forums.unrealengine.com/t/is-this-a-bug-in-the-uproperties/795957/4 "2023-03-23T14:22:50Z")

</div>

![Screenshot (106)](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/6/0/d60c96df98627174de4934cf731d6851259eb609.jpeg)

---

<div class="post-metadata">

**Author:** ![Jambax](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jambax/32/904177_2.png) [@Jambax](https://forums.unrealengine.com/u/Jambax)\
**Post date:** [March 24, 2023, 9:18am UTC](https://forums.unrealengine.com/t/is-this-a-bug-in-the-uproperties/795957/5 "2023-03-24T09:18:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dudebat923](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dudebat923/32/699029_2.png) [@dudebat923](https://forums.unrealengine.com/u/dudebat923)\
**Post date:** [March 24, 2023, 1:38pm UTC](https://forums.unrealengine.com/t/is-this-a-bug-in-the-uproperties/795957/6 "2023-03-24T13:38:28Z")

</div>

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