So this has been puzzling me for the last hour, and I still don’t understand what’s happening.
My setup is that the PlayerController receives the input, then use an interface to transfer the float value to the currently possessed pawn.
Now, I exposed and double-checked everything, the Pawn is correctly possessed, the float value is correctly transferred and the function is executed. I can see with logs that there’s no issue at this level. However, it looks like AddMovementInput doesn’t do anything at all unless the pawn is selected in the World Outliner in the editor. If I launch the game outside of PIE or I don’t select anything in the World Outliner, pawn doesn’t move at all.
void ATWSpiritCam::MoveCameraForward(float ScaleValue)
{
if (!bCanMoveCamera)
return;
FVector DirectionVector = this->GetActorForwardVector();
DirectionVector.Set(DirectionVector.X, DirectionVector.Y, 0.0f);
ULog::Number(ScaleValue, "PawnReceivedInput:");
this->AddMovementInput(DirectionVector, ScaleValue);
}
The logging function works, selected or not, and the ScaleValue is correct. Everything works as expected as long as the Pawn has been selected at least once in the World Outliner. The Pawn inherits from ACharacter class, so MovementComponent is there and working.
Any ideas on what I may be missing? I don’t see anything related to focus or something like that.