playMaker

Author Topic: Smoothing a float value[SOLVED]  (Read 4643 times)

jayhfd

  • Junior Playmaker
  • **
  • Posts: 71
Smoothing a float value[SOLVED]
« 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
« Last Edit: January 01, 2013, 08:50:21 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Smoothing a float value
« Reply #1 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

nick_h82

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Smoothing a float value
« Reply #2 on: December 21, 2012, 05:45:25 AM »
Hi Jean,

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

Thanks,

Nick

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Smoothing a float value
« Reply #3 on: December 24, 2012, 04:19:50 AM »

nick_h82

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Smoothing a float value
« Reply #4 on: December 27, 2012, 12:50:02 AM »
Thanks very much!

Nick