I would like change or create variables depending on a choice, for example from an enumeration.
But I’ve not seen any way to create any kinds of variables in runtime using blueprint.
To easier explain what I mean I’ve taken a camera actor as an example:
Under Camera Settings change Projection Mode between Perspective and Orthographic.
See how the every variable change from being: Field of View, Constrain Aspect Ration, Aspect ration
to ortho Width, Ortho Near Clip Plane and Ortho Far clip Plane
Yes its possible within Blueprints and within C++. You can create variables to hold things like the Mode, FOV, etc, and then set those values through the blueprint whenever (in response to the player hitting a volume, changing an option, etc).
You should go ahead and read through these tutorials to get a better understand of variables and functions in Blueprints:
And be able to manipulate it by selecting the actor in the editor.
As I also mentioned and showed earlier about the Camera Actor, notice how the the variables change (gets hidden/shown/gets created) in the Details panel depending on the choice selected in the Projection Mode enumeration tab.
Ah, I think I see what you are asking for. My apologies for the confusion.
In C++, object properties(variables) can go through specialized code that shows/hides/re-arranges them based on whatever logic you want. All those variables on the Camera Actor were always there, they’re just hidden based on what value you set your Projection Mode to.
However, there isn’t anything like that for Blueprints.
You could probably automate the creation of a class/detail layout customization, but you’d need some intermediate data structure (like an Excel spread sheet or simple text file using some custom scripting language), and then a tool that runs and spits out all the C++ classes (which can be Blueprints) when you build the game. Do-able, but it would require some hefty C++ work and you’d lose one of the main benefits of Blueprints which is you don’t have to recompile the project when you add a new Blueprint variable.
After looking at your comment and later inspecting the cameras C++ code I understand what you mean.
While this doesn’t solve my problem I find it highly useful for development with Blueprint actors in the future.
I will continue to learn how C++ integrates in with Blueprints and continue my research.