# "Get Play Length" returns incorrect value

**URL:** <https://forums.unrealengine.com/t/get-play-length-returns-incorrect-value/373389>\
**Category:** Character & Animation\
**Tags:** unreal-engine, question\
**Created:** [October 15, 2016, 8:05am UTC](https://forums.unrealengine.com/t/get-play-length-returns-incorrect-value/373389 "2016-10-15T08:05:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_a5cd030c1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a5cd030c1](https://forums.unrealengine.com/u/anonymous_user_a5cd030c1)\
**Post date:** [October 15, 2016, 8:05am UTC](https://forums.unrealengine.com/t/get-play-length-returns-incorrect-value/373389/1 "2016-10-15T08:05:09Z")

</div>

Hi,everyone:  
Here is the story.  
I want the character play attack anim , and the attack rate can be changed in runtime(ie.you use an item that can temporarily increase your attack rate) , so the paly rate of the attack anim must be calculated dynamicly.  
the attack rate is in “hit/second”.So the rate should be (attack anim length)/(1/(attack rate)) , actually it equals to (attack anim lenth) \* (attack rate).  
the attack anim is stored in a “Anim Squence” variable , in the event graph I use the “Get Play Length” Node to get its length.  
In the attack to idle transion in animation state machine , I check two things :1 .Did the attack anim is almost finished. 2 . Is the player still press attacking button.Like this:

 ![110939-rtx截图未命名.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/0/1/d015e731c311b19cbedd63ce644144cb4dbf1537.jpeg)

```
Here comes the error: the charater plays the attack anim twice when I press the attack button once.If I just check "Is the player still pressing the attack button" , it will play the anim once and stop at the beginning of the second time.
I think the problem is clear now: the anim is played a bit of faster , so the anim finished playing before a logic attack finishes , it will try to play the second time because I set the anim to loop.So I suspect that the return value of the "Get Play Length" Node is bigger than the correct value.
Have you encountered a similar problem? How you get the correct time of an anim squence? The engine version is 4.12 
Thank you!

```
