C++ Actor Components UPROPERTY's not showing in details panel

I have an Actor Component class URecoilSystemComponent, which containts the following UPROPERTY’s:

And in my character I create the subobject as per usual, yet in the details panel of the component in my character blueprint, none of the UPROPERTY’s show up? Ive restarted the editor multiple times, compiled multiple times, and used different variations of the UPROPERTY such as VisibleAnywhere, BlueprintReadOnly etc but none work (as far as I know EditAnywhere should be fine?).

Thanks for any help!

Hey !
You need to add Blueprintable on your component class maybe ?
So : UCLASS(Blueprintable)
If it’s not enough maybe add BlueprintReadWrite to your UPROPERTY also.

Unfortunately neither of those worked. For some more context the UPROPERTY’s are in the protected section which I believe is fine. Also the UCLASS I have is:

UCLASS(ClassGroup = (Custom), BlueprintType, Blueprintable, meta = (BlueprintSpawnableComponent))

This is very frustrating…

So I guess you are adding the component in your blueprint right?
Do you see them in the editor instead of the blueprint window when you select your actor?
Try puting them in public maybe ? Shouldn’t work but you know sometimes ^^
Also are you relaunching your project? Sometimes editing the headers ■■■■ the editor.

I add the component via c++ inside my characters constructor as per normal. Ive put in public as well, doesn’t change anything. Ive also restated the editor, refreshed the blueprint, upgraded unreal, nothing works. I just think its a bug at this point, it isnt a huge issue as there are alot of ways to go around this but just quite annoying to not have direct access to the component via properties.

Try assigning a default value to your uproperties in the constructor.

1 Like

/** The CapsuleComponent being used for movement collision (by CharacterMovement). Always treated as being vertically aligned in simple collision check functions. /
UPROPERTY(Category=Character, VisibleAnywhere, BlueprintReadOnly, meta=(AllowPrivateAccess = “true”))
UCapsuleComponent
CapsuleComponent;

would be my recommended setting copied from character,

so this definitely should work,
since it didn’t work for you I can only think of one funky problem
which is if you create an object, then add a component
Unreal sometimes goes haywire, the only way for me to fix this so far is to recreate the object.

Try creating a new Actor of this class and see if this works.

1 Like

On that note, it has definitely nothing do with your property settings for min/max pitch/yaw,
since all default component properties are missing not only the new one you added

I’m speechless. It has been two years but no one at Epic can help with this issue. I’ve encountered this exact same issue in the 4.27 version and it’s very simple to reproduce:

  1. Create new C++ Actor and ActorComponent classes; say, MyActor and MyActorComponent respectively
  2. Create any UPROPERTY variable in the MyActorComponent (the visibility option doesn’t matter)
  3. Attach the new MyActorComponent to MyActor in MyActor’s constructor using the CreateDefaultSubobject function
  4. Compile the codes, and restart the editor if you will.
  5. Create a new BP class inherited from MyActor, click on the MyActorComponent, and check the Details panel
  6. Nothing being shown there

On a side note: if I manually attach the component in the Blueprint class from the editor, everything shows up properly.

I’ve plowed through the documentation, engine codes, and forums but still couldn’t find any solution. Such a world-class AAA game engine it is!

Somehow I wonder whether people at Epic really care about solving users’ problems or if they are just content with what they have because, hate it or like it, there’s practically no competition in the AAA space and you either use their product or roll your own; which the later option is impractical for the most studios.

I’ve attached the screenshot in case anyone wonders whether the issue is real.

I’ve solved this problem. Please pin down this comment in case anyone who is having the same issue wants to know the solution.

If you want your C++ component to show up in the Details panel, you MUST declare a variable for your component and make it a UPROPERTY.

I haven’t tried whether it needs to have a specific combination of specifiers but VisibleAnywhere and BlueprintReadOnly worked just fine for me, so I’m going to stick with this.

I wish this would have been in the documentation somewhere, but, well. That would be too much to ask for, considering the state of documentaion where most of them just repeating the API’s declaration (as if it wasn’t already obvious enough).

4 Likes

This is literally mentioned everywhere, in the Unreal Engine Documentation and in almost every C++ course (even the free ones by Epic) or video on Youtube. If you don’t mark it as UPROPERTY it can be garbage collected at any time and it can’t be exposed to BPs.

If you want to be able to EDIT the variable/component in BP (with nodes) you need the BlueprintReadWrite specifier, if you just need to be able to GET the values of variables from Blueprint you just need BlueprintReadOnly, this is pretty self-explanatory.

The EditDefaultsOnly, EditInstanceOnly and EditAnywhere specifiers are used to determine WHERE you can edit the marked variables.
The first, as its name suggests, lets you only edit the variable in the archetype’s details panel (the blueprint editor), the second one lets you edit it when you create an instance of the class containing your variable (for example, when you place an actor in the world and click it, it will be shown in the details panel), the third lets you edit it in both places.

Mentioning your previous claim, the visibility DOES matter, there are three other specifiers that are not compatible with the edit specifiers I mentioned above, and they are VisibleAnywhere, VisibleDefaultsOnly and VisibleInstanceOnly and their names are also self explanatory, if you use them you’ll be able to see the values in the respective areas but not to edit them.

I can understand your frustration, sometimes I’ve been looking for a solution for entire days and then discovering it was a stupid thing not mentioned anywhere (a missing module for example…), this is not just for Unreal, this is Programming in general. No one really cares about your problems, you have to consider yourself lucky if someone decides to answer to your question in a forum (If you look at my profile almost every question I asked is without a solution :headstone:)

I hope not to have bored you, and I hope I helped you understand how these specifiers work instead of “sticking with random ones because they worked just fine”.
Have a nice day!

4 Likes

Hi !
You need to set the Variable of the component as “EditAnywhere” or “EditDefaultsOnly” from the Actor when you are adding it.

For example, if you are adding a component to your character actor, then in the .h of your character actor, you must declare the component variable with the prefix “UPROPERTY(EditAnywhere)”

1 Like

I think it probably not the kinds of UPROPERTY issues. That might be the reason that initialization of this component was failed due to you altered some property of this component, like class name or something. I had encounter several times but I still can not really resolve it.
but here’s somethings I did:

  1. just remaking all those relative blueprints, yeah, I’m serious.
  2. Remake that broken class, rename it is not helping, you have to kill it. Make new .h file, make a new name, etc.
  3. If your component has BlueprintType in UCLASS(), try add a new component directly in blueprint, see if it can normally show details.

Both way can resolve it in a stupid way, at least it worked.