Using PawnClientRestart
does help somewhat because with that change the EnhancedInput system is now in effect in the player character. Yay!
That has enabled me to narrow it down to one line of code. Predictably, its when the AIController
possessed the player character.
NO POSSESS
Without the call to possess, my input bindings work and I get a call to the HandlePointAndClickInput
function where I show a debug text on screen WalkToLocation
. So it gets the location, but I don’t have an AIController to walk the character over the nav mesh. Ba-bow.
WITH POSSESS
Current situation (as checked into Github) is that when this line of code runs, the binding to the input action stops working:
AdventureAIController->Possess(PlayerCharacter);
This is from the tutorial. (done in blueprints)
And the Enhanced input is there, its firing and I can see that from the ShowDebug EnhancedInput
that I’m running from the console (the yellow text) but its not firing the binding to HandlePointAndClickInput
any more.
I’m following this tutorial here:
and translating into C++ as I go. I can’t understand Blueprints - too much spaghetti.
What I don’t understand is the lifecycle of these things. This is a screenshot of my debug trace. Why is there no PawnRestartClient
when the possess happens?
The first call to AAdventureAIController::OnPossess
happens because the Class Defaults for the character are used to instantiate the AI controller into the scene:
Without that there’s no AI controller. But the hover text for Auto Possess AI says
…which seems to imply that is should be possessed? Which implication is shored up by the OnPossess
debug output.
So why the different behaviour when I call this line of code?