playMaker

Author Topic: Clean way to turn get axis into a bool? [SOLVED]  (Read 1937 times)

everycolorfades

  • Playmaker Newbie
  • *
  • Posts: 20
Clean way to turn get axis into a bool? [SOLVED]
« on: July 24, 2018, 02:38:38 PM »
I'm making a 3d sidescroller so I'd like to have get axis register more as get button down, where it's either on or off, however I like that get axis seems more universal without having to mess around with key codes from multiple controllers.

The issue I'm having is the multiplier, it takes a second or two for the axis to reach it's full amount so when the right key (or whatever direction) is no longer pressed it will take a second before my character stops running.

So even if I turn the value into a bool, say if >.1=on, the multiplier will still go all the way up to 1, which is fine until the key is no longer pressed and the 'cool down' period starts.
Any ideas?
« Last Edit: July 25, 2018, 07:55:38 PM by djaydino »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Clean way to turn get axis into a bool?
« Reply #1 on: July 25, 2018, 03:52:32 AM »
Hi,

 you need to tweak the Input setting for them axis, it;'s inside the Input manager of Unity that you can remove any latency and your axis is going to have no easing.

https://docs.unity3d.com/Manual/class-InputManager.html

else, compare the axis value against 0 with a very small threshold, and that will do too, as soon as the axis is not zero, you raise a bool to true.


Bye,

 Jean

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Clean way to turn get axis into a bool?
« Reply #2 on: July 25, 2018, 07:54:24 AM »
Hi.
Inside the input manager you need to set the 'Gravity' and the 'Sensitivity' to a high number.

Also you can use the action 'Axis Event' if you use them as a on/off state or 'Axis Event Extended' (on the Ecosystem)

everycolorfades

  • Playmaker Newbie
  • *
  • Posts: 20
Re: Clean way to turn get axis into a bool?
« Reply #3 on: July 25, 2018, 06:10:09 PM »
Thanks guys, that was exactly what I needed.  ;)