Hello Guest

Author Topic: Not sure if it's a bug or design decision.  (Read 3197 times)

test84

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Not sure if it's a bug or design decision.
« on: March 31, 2014, 01:36:43 pm »
Hi,

I wanted to change animation of one of my sprite animators via calling "Play("myClipName")" upon it but it was not successful and animation wouldn't change. Then I realized that I checked "Play automatically" in editor for that sprite animator and once I de-checked it, it was working. So in another way, that check box was forcing the initial animation in animation changes in the future. I tested this in both 2.3.3 and 2.4.0 and was suspecting it might be a bug since this behavior seemed strange to me.

Let me ask a question as well, is there any way to call an animation and force it to restart it if it's already playing back?

Thanks.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Not sure if it's a bug or design decision.
« Reply #1 on: March 31, 2014, 07:18:09 pm »
Its a design decision.
You can use PlayFromFrame("", 0) to restart it.

test84

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Not sure if it's a bug or design decision.
« Reply #2 on: April 01, 2014, 11:10:24 am »
Wish it would throw a warning or been mentioned in the docs as I found the solution totally by accident.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Not sure if it's a bug or design decision.
« Reply #3 on: April 01, 2014, 02:07:27 pm »
It sure is mentioned in the docs. "Will not restart the clip if it is already playing."
http://2dtoolkit.com/docs/2.4/html/classtk2d_sprite_animator.html

test84

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Not sure if it's a bug or design decision.
« Reply #4 on: April 01, 2014, 02:33:23 pm »
It sure is mentioned in the docs. "Will not restart the clip if it is already playing."
http://2dtoolkit.com/docs/2.4/html/classtk2d_sprite_animator.html

I actually meant the other thing, play automatically persistently forcing itself on change of clip.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Not sure if it's a bug or design decision.
« Reply #5 on: April 01, 2014, 03:08:14 pm »
I dont understand that one - play automatically does nothing different to you calling Play on start. In fact, thats all it does...

test84

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Not sure if it's a bug or design decision.
« Reply #6 on: April 01, 2014, 09:36:21 pm »
I dont understand that one - play automatically does nothing different to you calling Play on start. In fact, thats all it does...

That's what I described in first paragraph of my first post, apparently I wasn't clear enough. When I tick the check box to play automatically an animation, I can't change it later with calling Play on the animator.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Not sure if it's a bug or design decision.
« Reply #7 on: April 01, 2014, 11:15:05 pm »
"Let me ask a question as well, is there any way to call an animation and force it to restart it if it's already playing back?"

I was answering that question. If you call Play on a clip that is already playing by whatever means, its not going to restart it. Ticking "Play Automatically" is no differently to calling Play on Start.