The property of BP (derived from C++) class "doesn't" change after assigning to specific object

I don’t know if it is a bug or not, but when I write this in my custom C++ class:

UPROPERTY(EditDefaultsOnly, Category = "Item")
AItem* Item;

and trying to assign some existed-in-level objects in this field, I see only “None” in this field. It seems nothing was happend, but the trick is that assigning works, actually.

Can someone explain me the way it is?..

P.S. No such problems so far with this:

UPROPERTY(EditDefaultsOnly, Category = "Item")
TSubclassOf< class AItem > Item;

Try this :slight_smile:

  • Close the editor
  • Rebuild your C++
  • Open the editor

It should be fixed now. Sometimes the hot reload feature just doesn’t work properly

Nope. I did it a few times. Another one – still isn’t showing properly.
Deleted all temporary files as well, and the same result.

It’s “None” in Editor (in Class Defaults), but when I press Play, all the logic with this properties\fields is working as it meant to be.

When you set your property from the editor does it stays “None” or does it actually changes properly ?

If you set you default property value withing the C++ does it also shows “None” ?

I mean. Try to change your UPROPERTY type to an int, set its default value withing the constructor, and check if the value is correct in the editor :slight_smile:

Why and how should set it with some object when there are no object before Editor’s start?..

Everything else is fine until I write

UPROPERTY(blah-blah-blah)
CustomClass* CustomClassName;

I bet that it’s because AItem’s header is not included, but instead I wrote

class AItem;

Oh you are using a forward declaration. Yeah that sounds a good reason for Unreal to be fudged up. Well, did you tried to actually include your header if it’s possible ?
If not, try to use another class or even create a “testclass” to see if including the header fixes the issue.

If the forward declaration is the issue, you could submit a bug report :wink:

I’ve met circular dependency, this’s the reason for forward declaration.
The same with including a header (tried it in another class, a similar one).

I have no more ideas haha. This is really weird, I’ve already encountered the “always NONE” value but restarting usually fixed this. You’ve probably got into a bug. Maybe someone from staff would help you better than me. Good luck !

Thank you for help. Have a good life!