Using TimeRemaining(ratio) causes performance warning

I have enabled “Warn About Blueprint Usage” in the Optimization section of the animation editor.

This generates a warning on any usage of TimeRemaining(ratio)(animationname).

“xxx uses Blueprint to update its values, access member variables directly or use a constant value for better performance.”

I am confused - it appears TimeRemaining(ratio) only reads a value, and I do not see any other way to determine when to initiate the transition unless I use an animation notify.

What is the recommended approach - should I replace every TimeRemaining(ratio) with custom Animation Notify?

TimeRemaining(ratio) is used extensively in examples in the docs.

Thanks for any advice

Class Settings -> Details -> Optimization -> Warn About Blueprint Usage is flase

I don’t think you can do this with only blueprints. One way to get around this is to use an AnimInstanceProxy to query the state machine and store the value in the AnimInstance. You can then just read that int in the AnimInstance graph. The warning happens because TimeRemaining* are all calls to functions rather than simply reading a variable.

Thanks Waves - I think you are right - it is flagged because of the function call. We eventually ended up going with a AnimInstanceProxy because we wanted to stay in the FastPath.

It was funny to see this post come back after 4 years without an answer :wink:

Thanks again