How to SKIP the blend in Set View Target With Blend?

I’m making a game that require extensive use of transitional camera blends (player clicks an object, view blends to a an animating camera, the animation plays out) and also requires these animations to be skippable if the player wishes to skip it. I already have a solution for skipping the camera animations, but I don’t know how to skip the blending part. Right now if I skip an animation during a blend, the camera will continue on with the blend, even though the animation has already finished. I haven’t yet found anything exposed in blueprints that lets me do this. Is it possible?

After playing around with it for a couple days, I found a very hacky way to accomplish my goal. If you call Set View Target With Blend while a blend is currently happening, it will overwrite it. So I added the following code to my Skip function.

All it does is store a reference to the current view target, find a reference to ANY other object in the level and blend to it, then blend back to the original view target. The middle step was necessary because if I tried to set the view target to something that was already the view target, nothing would happen.

I don’t want to mark this as answered though because I’d really like to know if there’s a better way to do this.

Even though this is quite old, but maybe someone stumbles upon this and wants to use a less ‘hacky’ way. In 4.20 the PlayerCameraManager (which is set in the PlayerController) has a C++ Property BlendTimeToGo, which can be set to 0.0f.

So

void UMyClass::Skip()
{
    APlayerController* PlayerController = UGameplayStatics::GetPlayerController(this, 0);
    PlayerController->PlayerCameraManager->BlendTimeToGo = 0.0f;
}

works fine in my case.

2 Likes