Then that means you are most likely using a version of UE4 greater than 4.12.5 as a bug was introduced in 4.13.1 where the tick function gets called in the blueprint. Meaning that the ensure statement in TankPlayerController::AimTowards
will fail. Simplest solution is to remove the ensure statement so it just reads
void ATankPlayerController::AimTowardsCrosshair()
{
if (!GetControlledTank()) { return; }
FVector HitLocation; // Out parameter
if (GetSightRayHitLocation(HitLocation)) // Has "side-effect", is going to line trace
{
GetControlledTank()->AimAt(HitLocation);
}
}
Bug report listed here: