playMaker

Author Topic: How to store mouse speed on the x-axis in a float? [SOLVED]  (Read 1967 times)

Digital Adam

  • Full Member
  • ***
  • Posts: 208
How to store mouse speed on the x-axis in a float? [SOLVED]
« on: October 23, 2015, 07:08:40 PM »
I have a mouse look attached to my character, which turns the character along the y-axis when moving the mouse left and right. That works fine. Now I need to add turning in place animations.

I have a 1D Blend Tree that has an idle at 0, a left turning animation at -1, and a right turning animation at 1.  The animations play based on a float value from -1 to 1. What I'd like to happen is if I move the mouse left it "adds" into the float a negative value, the faster the mouse moves left the higher the negative value. If I move the mouse right it adds a positive value, and of course if there isn't any mouse movement then the float is at 0.  What Actions can I use to store those values in a float?

Any help would be appreciated. Thanks!
« Last Edit: October 26, 2015, 10:07:57 AM by Adam Z »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: How to store mouse speed on the x-axis in a float?
« Reply #1 on: October 25, 2015, 04:19:56 PM »
Hi,
i made an action for this, could you test if this works for you and if i should add something to it.

Digital Adam

  • Full Member
  • ***
  • Posts: 208
Re: How to store mouse speed on the x-axis in a float?
« Reply #2 on: October 26, 2015, 10:07:18 AM »
Thanks for this!