Author Topic: SetMotion: End and animation hiccups  (Read 2281 times)

0 Members and 1 Guest are viewing this topic.

Offline Doan Sephim

SetMotion: End and animation hiccups
« on: July 17, 2021, 06:37:18 PM »
I have an animation that goes through various stages, so I have it scripted out in a changeState method.

I have the cycleSpeed set to 4, but when the animation reaches its final cel and moves on to the next state, the last cel lasts for only 1 game cycle before moving on to the next state.

This makes sense because it moves to the next state when it reaches the end because I told it to with SetCycle: End self.

Is there an elegant solution to this to make the last cel last for the full amount of gameCycles (according to what cycleSpeed is set at) before moving to the next state?


Artificial Intelligence Competition

Offline MusicallyInspired

Re: SetMotion: End and animation hiccups
« Reply #1 on: July 17, 2021, 09:14:48 PM »
Put a new state in between that only lasts for as many cycles as your cycleSpeed (maybe one less actually) before continuing on to the next state of whatever you want to happen.

Code: [Select]
(1
    (anObject cycleSpeed: 4 setCycle: End self)
)
(2
     (= cycles 3)
)
(3
     (doMoreCode)
)

If your cycleSpeed is set to 4. I'm guessing with this because obviously the last cel will take up at least one game cycle before it moves on to the next state. I can't recall if cycles correlate to cycleSpeed exactly...but adjust as visually necessary.
« Last Edit: July 17, 2021, 09:17:06 PM by MusicallyInspired »
Brass Lantern Prop Competition

Offline Doan Sephim

Re: SetMotion: End and animation hiccups
« Reply #2 on: July 18, 2021, 12:45:07 PM »
Thanks! That's a fairly reasonable work around, until I find a more elegant solution anyway.


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.033 seconds with 22 queries.