playMaker

Author Topic: Disable all player inputs  (Read 60 times)

Krillan87

  • Junior Playmaker
  • **
  • Posts: 62
    • View Profile
Disable all player inputs
« on: November 07, 2017, 06:14:46 AM »
Hi,
I have a simple question that I feel should be a simple solution to. Is there a action to disable all player inputs.

For instance, if a character dies I want to disable the inputs so you can't control your character when he is dead. To have a state that disable all the relevant FSMs are one way, but I feel that there should be a custom action for this instead.

Same thing goes if you maybe want to disable an action, but do not want to disable the whole FSM. For instance, if you want to disable the abillity to shoot while the character is jumping, but do not want to toggle off/on the jumping-FSM.

Right now I have a "jump-string" that I swap to a weird keyboard key, but there is a very dirty way. Here I just wanted to disabled the inputs from the space-key instead.

I feel like there maybe already is a simple why to do this, but I can't find it.

// Christian

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2280
    • View Profile
    • jinxtergames
Re: Disable all player inputs
« Reply #1 on: November 07, 2017, 09:02:27 AM »
Hi,
In code you would use a bool 'isEnabled' i think same can be done in PM by using a "bool test"

But you could also use a global event "disable/enable input" and disable pointing to a 'idle' state.

For the jump i would go for a bool test and have 2 states, one for jump only and the other for jump/shoot.

Krillan87

  • Junior Playmaker
  • **
  • Posts: 62
    • View Profile
Re: Disable all player inputs
« Reply #2 on: November 09, 2017, 12:36:37 AM »
Hi,
In code you would use a bool 'isEnabled' i think same can be done in PM by using a "bool test"

But you could also use a global event "disable/enable input" and disable pointing to a 'idle' state.

For the jump i would go for a bool test and have 2 states, one for jump only and the other for jump/shoot.

Hello again Dj Dino ;)

Aha, the idea with a global event would work. However, then I need to go into every fsm and add this empty state. I feel like that should be an easier way, but maybe I'm wrong.