This would be the proper way to do “constructors”, vs “initializer lists” below. Please add a UPROPERTY() above your actor pointer usage otherwise the object will be garbage collected shortly after it is instantiated.
Also, your example uses a version of your code created in stack memory rather than heap memory. It won’t last long, so you either need this to be a member variable of some other class (also with UPROPERTY) or it needs to be allocated with the new operator.