I’m trying to change the PlayerCharacter to my camera actor in my game but it’s a blueprint actor. Is there anyway to reference it properly in c++ for this? I tried
Never, ever, import blueprints into c++. You want the Blueprint Generated Class. A very important vital distinction. Blueprints do not get cooked and are not usable in a package game. Blueprint Generated Classes are.
TArray<AActor*> OutActors;
UGameplayStatics::GetAllActorsOfClass(this, MyActorClass::StaticClass(), OutActors);
// e.g. get location of first actor
OutActors[0]->GetActorLocation();
What I wrote will import a class, not an instance of a class. You won’t be able to get anything like location or anything. What you can do is use the TActorIterator to search the level for your camera object.
Then compare the found actor’s classes to your BP class.
You’ll need to load the blueprint class in the constructor of your c++ class and store a reference.