cocos2d-x icon indicating copy to clipboard operation
cocos2d-x copied to clipboard

setAnimation bugs, cannot change animation

Open pipe1404 opened this issue 4 years ago • 0 comments

  • cocos2d-x version: 4.0
  • devices test on: Windows 11
  • developing environments
    • NDK version: no
    • Xcode version: no
    • VS version: VS Community 2019
    • browser type and version:

Steps to Reproduce:

  1. set up an animate action on sprite using an animation of 4 sprites(in my case).
  2. call setAnimation using another animation of 6 sprites or more.
  3. build and run then it will cause out_of_range exception at _splitTime in Animate::update

I think that _splitTime is not updated to match new animation timing, so it causes an exception on new animation.

pipe1404 avatar Oct 14 '21 13:10 pipe1404