Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Krillan87 on November 07, 2017, 08:14:46 AM

Title: Disable all player inputs
Post by: Krillan87 on November 07, 2017, 08: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
Title: Re: Disable all player inputs
Post by: djaydino on November 07, 2017, 11: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.
Title: Re: Disable all player inputs
Post by: Krillan87 on November 09, 2017, 02: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.