cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.

Home Page:https://www.cocos.com/en/cocos2d-x

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

setAnimation bugs, cannot change animation

pipe1404 opened this issue · 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.