Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: marvmiller on April 15, 2011, 07:10:28 PM
-
I'm trying to simply determine if my Input Axis is Up/Dn or Left/Right and play the appropriate animation. I'm using a GetButtonDown action, but it of course just takes in the ButtonName Horizontal or Vertical. How can I tell which direction as in up or down, left or right? Do I need to do a check for positive/negative somehow? How? Any examples out there? A better approach?
thanks in advance
-
You could store the offsets from Get Axis Vector and then use Float Compare: https://hutonggames.fogbugz.com/default.asp?W80
However this seems like a common enough use case that it deserves its own action.
So I posted one here: http://hutonggames.com/playmakerforum/index.php?topic=137.0
Let me know how it works for you...
-
Wow! I'm very impressed! Thanks for responding so quickly! ;D
-
Hi,
Excellent!
There is also a another solution when only keyboard inputs is required, simply create two inputs, one for the positive input of a given control and one for the negative input of the same control. It works very well but of course needs customization on the inputs settings themselves. You would en up with VerticalUp and VerticalDown. That saves a lot of trouble and wiring in some situations.
Bye,
Jean
-
Nice solution! I forget sometimes how flexible the Unity Input Manager is...
-
Hi Alex,
Yes, and at the same time so impractical cause we have no access to the input settings via code, and only standalone offers a very limited/not-for-real-world-project user editing ability. A real pity, and I fear Unity is never going to do anything on that matter. Too bad really...
Bye,
Jean