playMaker

Author Topic: Need help with smoothing Float[SOLVED]  (Read 3492 times)

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Need help with smoothing Float[SOLVED]
« 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.
« Last Edit: May 13, 2015, 02:08:39 PM by Splankton »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Need help with smoothing Float
« Reply #1 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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Need help with smoothing Float
« Reply #2 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

Bye,

 Jean

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: Need help with smoothing Float
« Reply #3 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?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Need help with smoothing Float
« Reply #4 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

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: Need help with smoothing Float
« Reply #5 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.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Need help with smoothing Float
« Reply #6 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

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: Need help with smoothing Float
« Reply #7 on: May 13, 2015, 02:08:25 PM »
Yes, I have it working now, thanks Jean!