However, when I try to assign values to an element of the array in the property editor, it doesn’t let me do it. The dropdown is populated properly but upon clicking the assignment fails. This is while editing the property in an instance of a UMG widget:
The problem is in PropertyHandleImpl.cpp, FPropertyHandleObject::SetValue(), where there is a check that the property doesn’t have the flag EditInlineNew, and if so the assignment fails.
I believe the flag is set by the EditAnywhere specifier, but without it the values are not available for edit in the instance.
If I forget the struct and have instead two arrays, one for each UObject type, then it works as expected.
I hope it’s alright to bump an older topic, however after hours of research I have not found a solution for this. I tried Mowgl33’s suggestion, but no luck, the behaviour has not changed.
Is it possible to have an array of structs as a property that allows per instance edits?
I’ve found many topics about this, but no concrete solution.
I’m really not sure what you mean? Are you not able to create a struct that’s modifiable in the editor? I’ve had no issues doing this on my end but with a different method.
I initially learned how to use Structs in UE4 C++ from this tutorial:
Thank you for the video link, I did reference it during my research but I couldn’t solve this issue.
It’s very close to the OP, I have an array of structs where each struct holds a custom class object and an int. It’s set as an instance editable property, but trying to assign the object from the dropdown list just resets it back to None. I hope this makes sense, having trouble describing issues due to being new + not native english.
Thank you for your response though, I do appreciate it