[Bug]: StopSlotAnimation is ignored for secondary animations if triggered in the same frame as stopping a previous animation
Description
If an active slot animation is stopped via StopSlotAnimation and a new slot animation is started via PlaySlotAnimation within the same update/frame, subsequent calls to StopSlotAnimation fail to interrupt the new animation until it completes its full playback duration.
If loopCount is > 1, StopSlotAnimation remains ignored until all loop cycles have finished executing. That means if loopCount is set to infinite, then the slot node locks up permanently. It can no longer be stopped or reused.
Note: Calling ResetAnimation after stopping the slot allows subsequent animations to work, however, blending is completely lost so I don't consider this a solution or workaround.
Steps to reproduce
- Call PlaySlotAnimation to start playing Animation-A on a slot.
- Before Animation-A completes, call StopSlotAnimation to stop playback.
- In the same frame/update, immediately call PlaySlotAnimation to start Animation-B on the same slot.
- While Animation-B is playing, call StopSlotAnimation to interrupt it.
Expected Result: Animation-B should immediately stop playing and blend out.
Actual Result: StopSlotAnimation is completely ignored. Animation-B plays through its full duration (including any remaining loop cycles). If set to loop infinitely, the slot locks up permanently. The animation plays indefinitely and the slot can never be reused.
Version
1.12
Relevant logs
Source: FlaxEngine/FlaxEngine