Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: change Idle animation when its end  (Read 4257 times)

0 Members and 1 Guest are viewing this topic.

samad.sattary

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
    • View Profile
change Idle animation when its end
« on: July 16, 2012, 04:21:53 PM »

how can i change the Idle animation when its end ?
i have two idle animation i want switch them when one of them will be end

my actor is 2D!!! can i use the "IsAnimPlaying" ?
 please help me  :'(
Logged

piere

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Posts: 301
  • Sorry for any bad english in my posts. Game on !
    • View Profile
Re: change Idle animation when its end
« Reply #1 on: July 17, 2012, 07:53:42 PM »

Instead of using a normal idle animation, try using 2 separate animation names, and you can use the same animation sprites as the idle, just name it something different so it doesn't loop.

Do this.

actor.PlayAnim("anim1");
actor.PlayAnim("anim2");

After it plays the first animation, it should jump to the second animation. Let me know if that works. Another less effective way would be to just use this.Sleep(1000); put how many seconds the first animation is then use the play command to play the second one.
Logged

Spellbreaker

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • View Profile
    • Apeiron Studios
Re: change Idle animation when its end
« Reply #2 on: July 19, 2012, 03:09:33 PM »

PlayAnim is not so good in idle, because it blocks. I'd prefer to apply an event to the last animation frame in the sprite ( e.g. "changeIdleAnim" ). Then in the Actors Script you write

on "changeIdleAnim" {
this.IdleAnimName = "otherIdleAnim"
}

Of course you have to add the "otherIdleAnim" in the .actor file.

Greets,

Spellbreaker
Logged
 

Page created in 0.021 seconds with 20 queries.