Is there any way to get/set a BP variable by name alone? I know FindPropertyByName in CPP can be used to find a variable by its name and manipulate it. There seams to be a few market place plugins using that, but does that incur a heavy performance cost? I have an attributes system implemented (I’m not using GAS as my needs are far too simple to deal with needing GAS) and currently my interface functions are just doing a giant switch statement against a gameplay tag to get/set variables, but it’s such a management mess to deal with.
I don’t think using one of those plugins would slow your system down unless you had 100’s of 1000’s of inventory items…
That’s what I was thinking as well, but have little experience with profiling CPP and double so usage of FindPropertyByName.
1 Like
Couldn’t find any other solution than to get an engine plugin for this. I went with the below. Seams to work fine and I don’t see any performance changes in my profiling.
FProperty* Prop = Object->GetClass()->FindPropertyByName("SomeFloatProp");
float* ValuePtr = Prop->ContainerPtrToValuePtr<float>(Object);
I know how to do this from CPP. I was trying to do this from BP, but thank you for providing the code sample for those that need it for CPP.
As for why, I code all day as my day job. I just want to string boxes together when making a fun little game and not stare into code again.