I don’t know if that solves your situation, but that is what I use 99.99% the time (your FMyStruct& Out format)
I don’t think it does either. They seem to work different. A return ref allows for change to happen to the original object out side of the function while an argument ref is more for modification in the function. I am looking to modify outside the function.
Just checking, currently “GetStructRef” is verified working in c++ but not in blueprints? and can you verify the node itself is the issue?
yeah it seems to work in C++ but not BP.
// Called when the game starts
void UActionQueueTest::BeginPlay()
{
Super::BeginPlay();
// ...
MyStruct = FMyStruct(0, "name 0");
FMyStruct& ref = GetStructRef();
ref.Name = "name 1";
UE_LOG(LogTemp, Warning, TEXT("%d : %s"), MyStruct.ID, *FString(MyStruct.Name));
}
^^ output = 0 : name 1
^^ output = 0 : name 0
(the img is cut off but nothing is connected after the print node)
When I run the BP my C++ BeginPlay looks like this
// Called when the game starts
void UActionQueueTest::BeginPlay()
{
Super::BeginPlay();
// ...
MyStruct = FMyStruct(0, "name 0");
UE_LOG(LogTemp, Warning, TEXT("%d : %s"), MyStruct.ID, *FString(MyStruct.Name));
}
The log shows MyStruct is set properly before the BP runs.
This is how I am verifying the BP node. I can run other tests if you have any in mind.