Dear Friends At Epic,
If I set the play rate to -1 in the editor, the montage plays in reverse,
if I use play montage based on the anim instance in the code,
whenever the play rate is -, the skeleton just freezes.
So my question is:
How can I play a montage in reverse from the c++?
Here’s the function I am using, based off of a shootergame example
void AVictoryPlayerCharacterBase::OnRep_PlayMontage()
{
//modified from shootergameCharacter.cpp
if (RepAnim && Mesh && Mesh->AnimScriptInstance)
{
Mesh->AnimScriptInstance->Montage_Play(RepAnim, CurMontagePlayRate);
}
}
Here’s the AnimInstance.h Code:
/** Plays an animation montage. Returns the length of the animation montage in seconds. Returns 0.f if failed to play. */
UFUNCTION(BlueprintCallable, Category="Animation", meta=(InPlayRate="1.0"))
float Montage_Play(UAnimMontage* MontageToPlay, float InPlayRate);
#Rep
Try to use the above Montage_Play from C++ with a negative playrate and see if skeleton freezes or if it plays animation in reverse as it does in editor
#Work Around
Currently I must make a copy of the montage and set the playrate to be negative
#Thanks!
Rama