Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Splankton on May 11, 2015, 01:58:28 PM

Title: Need help with smoothing Float[SOLVED]
Post by: Splankton on May 11, 2015, 01:58:28 PM
I have a float value driving a Blend Tree in Mecanim.   Its just 3 states, idle, walk, run.  My problem is my float  (which is coming from a dragging input action) can at a certain speed, jumps between say idle and walk, until the dragging speed increases, so therefore the float increases and so then it'll jump between walk and run states.

I've tried using a low pass filter, lerping the float, but just cant get it working right.  Can someone help me smooth the float so it does not jump between my animation states. Thanks.
Title: Re: Need help with smoothing Float
Post by: jeanfabre on May 12, 2015, 03:13:17 AM
Hi,

 it looks to me that your slider should indeed be a 3 state system. so make your slider range from 0 to 3, and parse the slider value float as an int, so that you only get integers, and then this will avoid jumps I feel.

 Bye,

 Jean
Title: Re: Need help with smoothing Float
Post by: jeanfabre on May 12, 2015, 03:19:02 AM
Hi,

 sorry half replied :) then obviously your problem will be "how to turn this back to a 0-1 flaot range :) use the "remap" action found on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181)

Bye,

 Jean
Title: Re: Need help with smoothing Float
Post by: Splankton on May 12, 2015, 01:53:09 PM
Thanks Jean,
Just a bit confused how to use an int as a parameter in a Blend Tree?
Title: Re: Need help with smoothing Float
Post by: jeanfabre on May 13, 2015, 02:39:27 AM
Hi,

The way I understand your setup is that you have three animator states right? and you want to switch between them using a slider to decide which state you are in. the blend tree is just the transition between two given states,

Else can you do a screenshot of your setup for your blend tree, or maybe you can send it to me, I'll do an working sample.

 Bye,

 Jean
Title: Re: Need help with smoothing Float
Post by: Splankton on May 13, 2015, 04:08:55 AM
Yea i have 3 states inside a blend tree. But if i make an int as a blend tree parameter for the slider, mecanim doesn't let me select it. Only floats are used. So i don't know how to use an int to drive the blend tree.
Title: Re: Need help with smoothing Float
Post by: jeanfabre on May 13, 2015, 06:18:11 AM
Hi,

Convert the back int to float. Have tried that?


 can you share your blend tree?

Bye,

 Jean
Title: Re: Need help with smoothing Float
Post by: Splankton on May 13, 2015, 02:08:25 PM
Yes, I have it working now, thanks Jean!