A UFUNCTION has to be inside a UCLASS. Yours is declared outside any class and is later defined inside UCreateNewObject.
A UFUNCTION has to be inside a UCLASS. Yours is declared outside any class and is later defined inside UCreateNewObject.