Getting "Ensure condition failed" in TankPlayerController?

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:

https://issues.unrealengine.com/issue/UE-36929

1 Like

I am in 4.18 and this is still an issue so I reverted to this as well after reading your post.
if (!GetControlledTank()) { return; }

If you look at the issue in the link provided above, you’ll see that it’s fixed for 4.19.

Privacy & Terms