playMaker

Author Topic: Communite with animation curve  (Read 2701 times)

tim.holman

  • 1.2 Beta
  • Playmaker Newbie
  • *
  • Posts: 49
Communite with animation curve
« on: October 06, 2011, 05:34:28 PM »
I'm using an animation curve to animate a gui horizontal slider from left (0) to right (1). I need to get two values; a power variable on the first click (when bar is on the far right side), and an accuracy variable on the second click (when bar is on the far left side). Think of the kick off mechanic in Madden, or the throwing mechanic in MLB the Show. Once the user has clicked once, it stores that float variable, and moves to another state where they need to click again (for an accuracy variable). However, I need the slider to always move back to the left (towards 0) rather than to the right (towards 1), which is how it's setup by default.

What I've done is set up a new variable called "Accuracy" and set it to equal the "Power" variable as soon as the new state has been entered. That way, the bar starts in the same spot it left off at in the last state. My problem is, I can't figure out how to tell it to go back towards zero. To sum it up, I need to figure out a way to communicate with the animation curve in order to tell it to go back towards 0...

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Communite with animation curve
« Reply #1 on: October 07, 2011, 01:32:59 AM »
Hi,

 Can you not have two curves and compose them as required instead of trying to do with one curve only? create three variable, one for each state and one for the final composed value ( Accurary, Power and slider)

Hope this helps,

 Bye,

 Jean

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Communite with animation curve
« Reply #2 on: October 07, 2011, 04:07:50 PM »
Animate Float is great when animating between known values. In this case it sounds like Accuracy is variable. Try using Ease Float instead. You don't get the complete freedom of an animation curve, but you get lots of easing options.