AActor as a return type. How to do this? PLS!

int X;
//is the same as
int
X;
The * applies to the variable type, therefore the most logical syntax to use is the one at the bottom.

And to answer the second question, the reason for this not working:

AActor newfile::rFunc(AActor *pointer)
  {
   return *pointer; 
  }

This would work if you used int for example, but unreal have protected it’s classes from misuse (i guess).
What you do in this function is the following:

  1. Inputs an AActor* variable (a pointer) as argument
  2. Dereferences that pointer variable and returns it as a Non-pointer. Meaning, you return the actual AActor not the pointer