How to make an actor pulse to a beat?

I have an actor that I want to "pulse" to the beat of a song. More specifically I mean grow really fast for a short amount of time, on the beat, and then shrink slowly until the next one.

I've tried using the interpolate behavior to say: after 0.3 seconds, if self.height = 25, interpolate over 1.121 seconds to 30, if self.height = 30, change attribute self.height to 25
BUT what happens is it just pulses once then stops.

The beats happen ever 1.121 seconds after a .3 second delay.

Comments

  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Use a display text behaviour on your actor, you will see that when it finishes its interpolation, its very rare it finishes on the exact number ... i.e. 25 or 30 in your example.
    This will be why it only pulses once as your rules dont fire again as the width isnt what you are expecting.

    You could try something like when width is < 26 and then when width is > 29

    Hope that helps
  • CandDAppsCandDApps Member Posts: 5
    YES it worked! Thank you!
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    edited March 2013
    Try this:

    Timer Every 1.421 seconds
    -- Interpolate: self.Size.Height To: 30
    ----Duration: 1.121 Function: EaseOut
    --Timer After 1.121 seconds √Run to Completion
    ----Interpolate: self.Size.Height To: 25
    ------Duration: .3 Function: EaseIn
Sign In or Register to comment.