Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: jayhfd on April 20, 2012, 04:36:19 PM

Title: Smoothing a float value[SOLVED]
Post by: jayhfd on April 20, 2012, 04:36:19 PM
Hi,
I know there are various options for smoothly going from one float to another. My question is, how would I smooth one float in a similar fashion to how you smooth look?

I'm adjusting pitch based on speed, and when there's sudden speed changes, it sounds wrong. I'm using sample curve to read a speed var and translate that into 0-1 pitch. I just want to be able to smooth that pitch value.

This seems like it'd be easy but I can't seem to figure out how to do it. My only thought is setting up an fsm with a delay where I read 2 speed vars every .5 seconds and smooth between the before and after speed floats...

Thoughts?

Thanks!
Jay
Title: Re: Smoothing a float value
Post by: jeanfabre on April 21, 2012, 02:49:10 PM
Hi,

 simply use "float interpolate" that would get you some smoothing, ahving a float trying to catch up with another, adjust the time it would take to smooth out more or less.

Also, you might want to check "Vector3 low pass filter" action, and maybe apply the same system to a float, thyt could be what you are after. If you need a custom action to low pass filter just a float, tell me, and I'll do it.

 Bye,

 Jean
Title: Re: Smoothing a float value
Post by: nick_h82 on December 21, 2012, 05:45:25 AM
Hi Jean,

Did the Float low pass filter ever make it into Playmaker?

Thanks,

Nick
Title: Re: Smoothing a float value
Post by: jeanfabre on December 24, 2012, 04:19:50 AM
Hi,

 here we go:

http://hutonggames.com/playmakerforum/index.php?topic=2808.0 (http://hutonggames.com/playmakerforum/index.php?topic=2808.0)

bye,

 Jean
Title: Re: Smoothing a float value
Post by: nick_h82 on December 27, 2012, 12:50:02 AM
Thanks very much!

Nick