(using urho3d from git, w7 x64)
Animation that comes with Urho3D, works right when flipping.
But when I try to flip my own animation, crash.
AnimatedSprite2D* animatedSprite = playerNode->GetComponent<AnimatedSprite2D>();
if (input->GetKeyDown(KEY_LEFT))
animatedSprite->SetFlipX(true);
It crashes on AnimatedSprite2D.cpp at OnFlipChanged() method
void AnimatedSprite2D::OnFlipChanged()
{
for (unsigned i = 0; i < numTracks_; ++i)
{
if (!trackNodes_[i])
continue;
StaticSprite2D* staticSprite = trackNodes_[i]->GetComponent<StaticSprite2D>();
staticSprite->SetFlip(flipX_, flipY_); /////<<<<<<<<<<<--------- when i==3, staticSprite==null
}
// For editor paused mode
UpdateAnimation(0.0f);
}
Tried “key all” in Spiter, doesnt help. Dont know how I must setup my character that it works right.
Here is my stupid character+anim (you can use whatever images) in case someone wants try it out
ukko2.scml