diff --git a/Source/CharacterPlugin/Private/FaceAnimation/VHFaceAnimation.cpp b/Source/CharacterPlugin/Private/FaceAnimation/VHFaceAnimation.cpp
index 80b0fd9bfad9f9343b0a7927c9208c74c8d72437..3e70d76ecc673ba48f2914afb21a566766e3bde6 100644
--- a/Source/CharacterPlugin/Private/FaceAnimation/VHFaceAnimation.cpp
+++ b/Source/CharacterPlugin/Private/FaceAnimation/VHFaceAnimation.cpp
@@ -190,16 +190,16 @@ void UVHFaceAnimation::TickComponent(float DeltaTime, ELevelTick TickType,
LastFrameNr = FrameNr;
ApplyFrameData(FrameNr);
+ bIsFaceReset = false;
}
- else
+ else if (bResetFaceAfterFinish && !bIsFaceReset)
{
- if (bResetFaceAfterFinish)
- {
- //in case this is used together with a FacialExpression
- //we have to do this, so that the right data is pulled from the
- // FacialExpression component every frame (especially before staring that actual animation)
- ResetFace();
- }
+ //in case this is used together with a FacialExpression
+ //we have to do this, so that the right data is pulled from the
+ // FacialExpression component every frame (especially before staring that actual animation)
+ ResetFace();
+
+ bIsFaceReset = false;
}
}
diff --git a/Source/CharacterPlugin/Public/FaceAnimation/VHFaceAnimation.h b/Source/CharacterPlugin/Public/FaceAnimation/VHFaceAnimation.h
index aa3ca1769a717d862b19c80327d0c9681c9b799f..5f6e287c9a85c2c9409359674980f81967046446 100644
--- a/Source/CharacterPlugin/Public/FaceAnimation/VHFaceAnimation.h
+++ b/Source/CharacterPlugin/Public/FaceAnimation/VHFaceAnimation.h
@@ -124,11 +124,13 @@ protected:
TMap<FString, FAnimationData> CachedAnimationData;
bool bCurrentlyPlaying = false;
+ /** Essentially indicates whether the face has not been reset i.e. whether it is considered 'dirty' */
+ bool bIsFaceReset = true;
float CurrentPlayTime = 0.0f;
float FadeFraction = 0.0f;
int LastFrameNr = 0;
- UVHAnimInstance* AnimInstance;
+ UPROPERTY() UVHAnimInstance* AnimInstance;
bool UseMorphs = true;
public: