AIController (or Detour Crowd AI controller) reports Last Input Vector as zero

Hi,

Using UE5.3.2. In my test I have three unique pawns (pig, chicken and casowar), all of them uses same logic. I have custom logic for calculating speed and steering and then have proper animation played, in which I’m relying on “Get Last Input Vector” from Pawn’s CharacterMovement component.

And here is my problem, two of those unique pawns moves and I can get " Last Input Vector" value bigger than zero. But in third unique pawn AIController (or even Detour Crowd AI) returns zero all the time, even MoveTo tasks moves pawn across scene, and I’m printing some debug info whwre vector and rest of the relying variables returns zero, since I can’t get that vector I can’t calculate speed for animation blueprint to display proper animation and properly rotate pawn towards its movement direction.

And basically I do not know what to do next.

I tried completely rebuild that one pawn, all of these Pawn have same parent buleprint to manage all of its logic, anim BPs are all unique byt movement logic is the same for all of them. And actually I took anim bp of one of the properly working pawns, duplicated it and fix castings, variables and replaced animations and still nothing changed.

thanks for any lead

Is the third one that does not react have an AI controller assigned?
Does it have ‘Auto Possess AI’ set to ‘Placed in World or Spawned’

Yes, of course. Ai Controller is assigned, as BT works, that means it waits, it moves, it attacks, but controller doesn’t return this Last Input vector.

‘Auto Posses AI’ is by default set to Placed in World for all of them.

Perhaps try triggering Consume Movement Input vector in your custom logic

from pawn.h


	/**
	 * Returns the pending input vector and resets it to zero.
	 * This should be used during a movement update (by the Pawn or PawnMovementComponent) to prevent accumulation of control input between frames.
	 * Copies the pending input vector to the saved input vector (GetLastMovementInputVector()).
	 * @return The pending input vector.
	 */
	UFUNCTION(BlueprintCallable, Category="Pawn|Input", meta=(Keywords="ConsumeInput"))
	ENGINE_API virtual FVector ConsumeMovementInputVector();

Thanks, unfortunately ‘Consume Input’ also returned zero :frowning:

Is the character contacting the navmesh correctly?

You can also try adding SpawnDefaultController on BeginPlay in your Pawn and see if that has any effect.

Yeah, contact with navmesh is correct. I added SpawnDefaultConrtoller also with no effect.

The fact that BT is able to move that pawn across scene correctly is weird. It can track any targer and move to its location, but cant return its vector of movement. Like it is decoupled, but very same logic drives other two without any issues.

Are you forgetting to call the parent of some function?