playMaker

Author Topic: Controlling Unity Slider with Playmaker Problem  (Read 2746 times)

mTruly

  • Junior Playmaker
  • **
  • Posts: 98
Controlling Unity Slider with Playmaker Problem
« on: February 23, 2016, 01:16:14 PM »
I have a simple legacy animation of a cube moving across the screen.

I have setup a simple state in Playmaker that plays the animation and updates a Unity slider while the animation plays.  This uses:

Play Animation
Get Animation Time (puts the value into a variable)
UGui Slider Set Value (uses the variable to set the Unity slider value).

This all works fine.  The animation plays and the slider moves along with it.

Problem is... when the animation plays to the end... the animation stops on the last frame (as desired) but the Unity slider jumps back to the beginning.

Any idea why this is happening?  At the end of the animation, the normalized value should be 1 and the Unity slider should stay at 1 also (not jump back to 0).

Thanks for any ideas!

mTruly

  • Junior Playmaker
  • **
  • Posts: 98
Re: Controlling Unity Slider with Playmaker Problem
« Reply #1 on: February 23, 2016, 02:28:18 PM »
Hmmmm... seems like there is an issue with what the slider does depending on what the wrap mode is set to for the legacy animation.  It was set to 'Default' and the slider jumps to the beginning (even though the animation stays at the end 1 value).  But if I set the wrap mode to be 'Clamped Forever'... then when the animation gets to the end, the slider also stays at the end.  But using this setting gives me other issues.

So I worked around the problem in other ways.  I set the animation to go to another state when finished and in this other state I explicitly set the slider value to 1 which keeps the slider at the end as desired.

Thanks!