playMaker

Author Topic: Animation Control  (Read 2405 times)

mmzbr

  • Playmaker Newbie
  • *
  • Posts: 40
Animation Control
« on: October 17, 2012, 11:36:03 AM »
ThereĀ“s a way to make that with Playmaker: start an animation at a specify frame , stop/freeze on this current frame and wait for a trigger to resume the animation?

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: Animation Control
« Reply #1 on: October 18, 2012, 11:39:20 AM »
(I'm not being mean here, just trying to solve this problem permanently)
Now, let's see how to solve these questions. Use the search bar for the general category of your action. In this case, that's "Animation".  Read through the descriptions of the actions you find. There is no action which makes the animation jump to a certain frame, but there is one that lets you jump to a certain time : "Set Animation Time" .
Then to stop the animation you find "Enable Animation" , which can also disable an animation / pause it. If you want it to happen on say frame 210, and your animation started on 180, you divide your wanted frame by the default frame rate. Like, in my game frame 180 would be 3 seconds time since 180/60(fps) = 3.0 .

So now I know to Set the animation time to 3, use a wait action (wait depends on the frame rate) for 0.5 seconds (180 (start frame) - 210 (stop frame) = 30 and 30/60 = 0.5 seconds) and go to a new state with a trigger action in it.

Then once the trigger is triggered you can use the "Enable Animation" again, to start the animation from that frame.

Granted, this is not easy, but it's fairly direct and gets the job done even if it lags, since "wait" depends on exactly the same parameters as the animation.

If you didn't understand my explaination , do say so, I'll try to write it again :D It turned out to be a bit more difficult than I thought when I started writing it :P
Best,
Sven

mmzbr

  • Playmaker Newbie
  • *
  • Posts: 40
Re: Animation Control
« Reply #2 on: October 18, 2012, 10:18:12 PM »
(I'm not being mean here, just trying to solve this problem permanently)
Now, let's see how to solve these questions. Use the search bar for the general category of your action. In this case, that's "Animation".  Read through the descriptions of the actions you find. There is no action which makes the animation jump to a certain frame, but there is one that lets you jump to a certain time : "Set Animation Time" .
Then to stop the animation you find "Enable Animation" , which can also disable an animation / pause it. If you want it to happen on say frame 210, and your animation started on 180, you divide your wanted frame by the default frame rate. Like, in my game frame 180 would be 3 seconds time since 180/60(fps) = 3.0 .

So now I know to Set the animation time to 3, use a wait action (wait depends on the frame rate) for 0.5 seconds (180 (start frame) - 210 (stop frame) = 30 and 30/60 = 0.5 seconds) and go to a new state with a trigger action in it.

Then once the trigger is triggered you can use the "Enable Animation" again, to start the animation from that frame.

Granted, this is not easy, but it's fairly direct and gets the job done even if it lags, since "wait" depends on exactly the same parameters as the animation.

If you didn't understand my explaination , do say so, I'll try to write it again :D It turned out to be a bit more difficult than I thought when I started writing it :P

Scond time you save me, thank you very much for your time and explanation!