playMaker

Author Topic: Axis event question  (Read 2362 times)

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Axis event question
« on: June 07, 2014, 04:56:34 PM »
So I use axis event to get an 'up.  A translate is applied and the tank moves forward.  The issue now is that I don't know how to stop.

1) I have an 'idle' state just waiting for the 'axis event' of up. 
2) when it sees the input of up, it goes to a new state to move the tank
3) In the 2nd state, I use a translate to move the tank with every frame checked
4) The tank moves forward, but keeps on moving reguardless if the dpad is not in the up position.

So how do I stop the axis input when the up is no longer being pressed?


wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: Axis event question
« Reply #1 on: June 07, 2014, 04:59:40 PM »
and what does "Reset Input Axes" actually do or is used for?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Axis event question
« Reply #2 on: June 07, 2014, 05:18:31 PM »
You need an action to send the Go To Idle event.

You could use a Next Frame Event to return to Idle in the next frame. Or Send Event with a delay if you want a minimum move time. Or you could use the Axis Event action again with the No Direction event. Lots of options... :)

http://docs.unity3d.com/ScriptReference/Input.ResetInputAxes.html

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: Axis event question
« Reply #3 on: June 07, 2014, 06:13:22 PM »
So I figured it out.  On each state you have to only have horizontal or vertical selected.  Also I used axis event on each one.  Thanks.