Header files contain definitions of Functions and so the UFUNCTION only needs to be in the .h file. At the top of the link it says “UFunctions are declared in the .h class header file”. Once you add the code in the above post to your header file go to your .cpp file and implement the method, compile your code then you should be able to call the method in blueprints as long as it’s in scope.