I’m spawning two characters from blueprints in my level ::BeginPlay(). I need to assign a different PlayerController depending on various options the user has picked. So I do the following:
auto playerController = GetWorld()->SpawnActor<AHumanCharacterController>(AHumanCharacterController::StaticClass());
However, after I’ve called ::Possess() I see “Calling IsLocalController() while Player is NULL is undefined!” in the log window and it keeps pumping out this message while the game is running, the input binds I have set up in the controller aren’t getting triggered either. Using the PlayerControllerClass in the GameMode isn’t an option as these characters need different controllers for input types and AI control, I’ve been looking at this all day and I’ve hit a wall, what am I doing missing?
UCLASS() class API AHumanCharacterController : public APlayerController
virtual void SetupInputComponent() override;
virtual void Tick(float DeltaTime) override;
InputComponent->BindAction(TEXT(“ButtonB”), IE_Pressed, this, &AHumanCharacterController::test);
void AHumanCharacterController::Tick(float DeltaTime)