Make a Read-only variable in editor?

How do I make a variable show up in details panel of an instanced blueprint but grayed-out/read-only? I don’t want the variable to be private or not editable in-game.

1 Like

Is there any news about this issue?

You can’t and pretty much no real reason for it, blueprints made for casual developing and high-level implementation, the concepts like encapsulation or const correctness are blurry here or not supported at all, blueprints assume you know what you doing.

But this has nothing to do with object oriented programing, this is UI feature. Reflect system does support read only (grayed out) properties and you can do so in C++ and blueprint don’t have those implemented (or rether there missing option in variable properties). I can see 2 reasons why someone what to do so:

  1. Read-only field is good to show debug info on property editor which
    should not be edited, only displayed
  2. To block variables that are rendered useless when other option
    is enabled. Yes its different option
    but UE4 has it and it’s also only in
    C++

Only problem why it’s missing in blueprint i see might be related to fact that when you make varbale read only it’s not editable also in blueprint defaults (As it is tied with “Editable” flag and there no seperate option for defaults and details tab), making editing defaults of those varables in blueprint a lot more annoying

Well there are lot of reasons and it could be done via C++ easily – so why there should be any restrictions in blueprints?

But what is the difference between object oriented programming approach and UI feature from blueprint as programming point of view? If the feature is not available - feature is not supported, whatever semantics.

There too many things missed for blueprint properties, it feels like its not intended by design. Const variables, protected variables, const function input, function input is local variable (this one planned, but technically hard).

Also, the way how epic blueprints tutorials made, everything treated as public property and get changed in whatever place is handy.

313 views and no answer. I added a “Feature request” tag. Hopefully it’ll get some attention-.-

Check out this accepted PR request… I think it will be in 4.16…

https://github.com/EpicGames/UnrealEngine/pull/3222

Don’t you just mark it’s UPROPERTY as VisibleAnywhere rather than EditAnywhere (or VisibleInstanceOnly etc.)?

EDIT : That’s for a C++ variable showing in a blueprint - I guess you mean a Blueprint instantiated variable…

this may be old but useful. the only way I found to do this is have the variable set as instance editable but having the blueprint set it back to the value i want. it will not be grayed out but any edit of the variable value will be cancelled.

2 Likes