2020.1.15f1 How to set animations "LoopTime" to false from script

Hello everyone!

I spent good time trying to find any solution but everything I find seems to be for older versions or something?
Basically I want to set an AnimationClip.LoopTime from true to false or vice versa from script.
171934-screenshot-2020-12-02-161258.jpg
I want this to let the object finish the currently running animation cycle.

If I just set the Animator to enabled=false like it’s said in some posts, the animation stops right away of course and that leaves the object off position.

Somehow it has to be possible to just set looping=false and avoid having to create additional complicated transitions or something with the Animator?

Any help/hint is greatly appreciated!

Try creating a parameter called Loop in the animator and after playing set to false.
When playing just set a AND if Loop = true of some sort.

I was rolling this through my head yesterday evening afk and I decided adding an event to the animation clip would be the best solution.

If anything depends on the frame the animation is in (in my case being back at its original position) use an event and notify the puppeteer script.

It’s easier wo write, understandable when seeing it later and most of all much cleaner.