Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: pietwelve on January 17, 2020, 10:05:59 PM

Title: curve instead of math float operator [SOLVED]
Post by: pietwelve on January 17, 2020, 10:05:59 PM
Hello,
I need a float coming from a [0; 1] slider value to go through a math function (a curve) in order to get a other float ranging from other min & max values with possibility of non linear interpolation (ease in / out ...).
So i'd like a kind of "float math from curve" Action.
I'm sure you all do that all the time ! How do you do that guys ?
Thanks a  lot
Please excuse my English ;-)
PS : for now I use a "float operator" and "float add" Action ...
Title: Re: curve instead of math float operator
Post by: djaydino on January 18, 2020, 11:18:31 PM
Hi,
The Tween beta actions have a tween float where you can use curves :

https://hutonggames.fogbugz.com/f/page?W1714


i have been using them many times already and so far the actions are very stable (and will probably come out of beta on the next update, but you can use them now already)
Title: Re: curve instead of math float operator
Post by: pietwelve on January 20, 2020, 07:34:44 PM
Tanks djaydino !
I will try that :-)
Title: Re: curve instead of math float operator
Post by: pietwelve on January 21, 2020, 08:52:05 PM
Hi,
"Tween Float" animates floats right ? I dont want to animate :-)
- What i do now :
slider -> float value -> several (Math) float add/multiply ... -> Set property
But i need a complexe math operation ... and using a curve would be so simple !
So what i'd like to do :
slider -> float value -> curve (math function) -> Set property

Is there an Action that can apply a curve (math function) to a float ?
Thank you :-)
Title: Re: curve instead of math float operator
Post by: jeanfabre on January 22, 2020, 08:20:52 AM
Hi,

 yes, you can try CurveFloat, AnimateFloat or sampleCurve.

Try them all, and see which ones fits better your needs.

Bye,

 Jean
Title: Re: curve instead of math float operator
Post by: pietwelve on January 23, 2020, 01:13:03 PM
Hi Jean Thanks :-)
Yes !!!
I need the abscissa to be a slider value (not time) and the ordinate to be an other float variable.
The "sample Curve" Action is definitively what I need !
Thanks
Bye