playMaker

Author Topic: Axis event with pause [SOLVED with new action]  (Read 2740 times)

jumbojambo

  • Playmaker Newbie
  • *
  • Posts: 9
Axis event with pause [SOLVED with new action]
« on: September 24, 2019, 05:50:43 PM »
The 'Axis Event' action does not work when the game is paused.  I was wondering how to get around this.  Is there a raw axis action or something?
« Last Edit: September 29, 2019, 01:08:57 PM by jumbojambo »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Axis event with pause
« Reply #1 on: September 24, 2019, 06:02:27 PM »
Hi.
I believe you can find 'Get Axis Raw" on the Ecosystem

jumbojambo

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Axis event with pause
« Reply #2 on: September 24, 2019, 06:50:35 PM »
Yeah I found get axis raw.  I know how to code this in c# but not sure in playmaker.

So, when the pause time is 0, the menu pops up.  I can use the mouse to select the buttons.  I can use the joystick to select the button.  That means going up and down in the menu.  However, the keyboard LRUD arrows do not work.  So when using the 'axis event' and then paused, the keyboard arrow keys will not work.

I know this because if I just turn on the menu (and not pause the game), then the arrow keys work.  In playmaker editor I can see the outline around the state that has the 'axis event' in it.

I'm sure this has probably been explained a billion times before.  But when paused, how can I get the horizontal and vertical axis to work with the 4 arrow keys?

jumbojambo

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Axis event with pause
« Reply #3 on: September 25, 2019, 12:57:48 PM »
Also, the joystick and mouse still work when paused.  They are using a different FSM.  It just the action 'axis event' does not work with the keyboard when paused timescale 0.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Axis event with pause
« Reply #4 on: September 28, 2019, 07:48:26 AM »
Hi.
I just tried on a project and they seem to work on my end, arrows and wasd.

Maybe some settings in the input manager?

jumbojambo

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Axis event with pause
« Reply #5 on: September 28, 2019, 06:30:02 PM »
I'm not sure what the issue is then.
When the timescale is 0 they do not work.

Here are the input settings Attached.
Also the fsm.




jumbojambo

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Axis event with pause
« Reply #6 on: September 28, 2019, 06:40:11 PM »
Look at this code.  when time scale is 0, the action does not work.  When I make it something else, the action works.

I believe this is why axis raw was invented.  One can get the input of things when the timescale is 0.  So 1 solution is to make it really small.  the 2nd is to use a axis raw. 

I know how to do the first, but not the second.  So is there a workaround?  Also, this is a bug as people using this action will think it works when it does not.


There is a limit to the number of zeros you can have before it doesn't work anymore.  Of course this does not pause the game, it just gets really slow.
This is about as many zeros you can add and sill have the keyboard work: Time.timeScale = 0.000000000001f;


Any ideas?
« Last Edit: September 28, 2019, 06:47:06 PM by jumbojambo »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Axis event with pause
« Reply #7 on: September 29, 2019, 09:46:32 AM »
Hi.
ok, as you talked about a menu poping up i tought you mean moving around the ui buttons.
As you can move with wasd and arrows within canvas select-able objects without any actions. (you might need 1 to select 1st active button)

I made a Axis Raw Event and this should work (see attachment below)

I just edited the original Axis Event action and changed the : Input.GetAxis to Input.GetAxisRaw.
And renamed the action :)

Since you know how to code, have a look at the action scripts and also to the PlayMaker API page
It is very useful to know a bit how to make actions, especially if you have 3rd party assets that does not have PlayMaker support.

jumbojambo

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Axis event with pause
« Reply #8 on: September 29, 2019, 01:08:16 PM »
Yep, that worked.  If anyone is following along at a later date, you can use:
Time.timeScale = 0.00000000001f;
But that slows down the game super slow.  It's so slow you can't notice it.  You'd have to pause the game for many minutes to see anything move.

However, using this new action is the playmaker solution.  You use Time.timeScale = 0.0f;

Suggestion:  You should call it something like: AxisRawEventTimeScaleZero
to indicate that this is for when the timescale is 0.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Axis event with pause [SOLVED with new action]
« Reply #9 on: October 14, 2019, 02:09:40 AM »
Hi Kurt,

 Can you put that on the Ecosystem? thanks :)

 Bye,

 Jean