in BuildingEscape, we use #define OUT, but what does this do? I don’t fully understand it yet.
What is the OUT parameter and why do we put it in front of some variables?
I searched on Google, but I could not find what I was looking for.
This is a macro, a simple text replacement. It will replace all uses of “OUT” in the file with nothing. Ben is using it as a comment that it’s an out parameter.
FHitResult HitResult;
FCollisionQueryParams TraceParameters(FName(TEXT("")), false, GetOwner());
GetWorld()->LineTraceSingleByObjectType(
OUT HitResult,
GetReachLineStart(),
HitResult is being given a value by the function. It’s an output parameter.
It would work the same without it. Alternatively you could add a prefix to the variable name or use a multiline comment.