Why is this character being spawned without a controller

I have a blueprint that derives (via a couple of my own classes) from ACharacter. When I spawn it almost immediately (though it isn’t placed in the level), everything works correctly and calling APawn::GetController in its Tick returns a controller.

However, in a different piece of code, spawning the same BP with the same line of code, the tick fails to get the controller. What could be the cause of this?

After you spawn the character, do this:

NewCharacter->SpawnDefaultController(); //available in BP too

:slight_smile:

Rama

3 Likes

Well this has fixed it, thanks! But why does it require this line, but only when I spawn it later?