I don’t understand why this line gives error C4239, something about non standard conversion from FVector to FVector& for RandomPt. I’m learning c++ I have no idea what is wrong please help
… if you wanted to assign like you did above, i think you’d need to assign as a pointer, ie “OutResult = *Result;” … or is it “OutResult = &Result;” … one of those. my pointer operations never make sense when i’m running on no sleep.
but I don’t get it. What’s the point in passing a constant variable by reference if I’ll not be able to modify it, which is exactly what I’m trying to do? This doesn’t make any sense lol sorry for my ignorance.
The problem here is that GetActorLocation() returns an FVector by value, which you cannot directly pass to a mutable reference. Update your function to use const FVector& Origin.