I have a question about spawning actors using C++.
Here is my code:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = “Testing”);
UFUNCTION(BlueprintCallable, Category = “Spawn_Function”)
AActor* SpawnedActorRef = GetWorld()->SpawnActor<AActor>(RHC_Spawn, FVector(0.0f, 0.0f, 0.0f), FRotator(0.0f, 0.0f, 0.0f), SpawnParams); //Location, Rotation
Now, this code works but there is one thing I do not like. For it to work, I have to go in to my Blueprint editor and set RHC_Spawn to the class that I want to spawn. Check the picture.
Is there a way to do this assignment in C++. I have searched and searched and searched and have not found an answer on this. Using the editor to do the assignment is not the end of the world but if it is possible I do prefer C++. Is there a way?
Thank you in advance.