Hello. I've created a player class as AActor. I created a blueprint and set this player as parent class. In game mode class I wrote
I set this mode in preferences in editor and I can see pawn description and controller - everything correct. I set a breakpoint in Game mode and when I start a game I see that if() statement is executed. But BeginPlay() function never called for my player, and actually I can't see player mesh when I fly around. If I place blueprint in the scene BeginPlay() fired for this instance.
Upd.: I changed my default pawn from AActor to ADefaultPawn and now everything works. So what was the problem with Actor? Why can't I setup it as main player?
Code:
static ConstructorHelpers::FObjectFinder<UBlueprint> WarriorActorBPClass(TEXT("Blueprint'/Game/Blueprints/BP_WarriorActor.BP_WarriorActor'")); if (WarriorActorBPClass.Object != NULL) { DefaultPawnClass = (UClass*)WarriorActorBPClass.Object->GeneratedClass; }
Upd.: I changed my default pawn from AActor to ADefaultPawn and now everything works. So what was the problem with Actor? Why can't I setup it as main player?
Comment