Setting values and passing in struct in c++
Retrieval in blueprints
print out in game
Note that you are passing in a const ref of the struct in your version.
const means it’s constant and cannot be changed from within the function itself which counteracts the pass by ref which would only be usable if you planned on changing the struct from with the function.
I think the perceived error lies in your planning and execution of your pass in function.
You are probably making internal changes that have no impact on the passed in variable, in essence changing nothing with the internals of the function.
What exactly are you doing in the cpp? Are you just passing the struct to an internal variable or trying to modify it in some way?
It should work if you are just passing the var to a private version. I get the correct values even with a setter like this:
void UMyObject::SetStruct(const FMyStruct &MyStruct)
{
_MyStruct = MyStruct;
}