PlayMaker Help & Tips > PlayMaker Help

Key pression/depression behaviour

(1/1)

PolyMad:
I'm building a little car with PM and as controls I am setting up WASD.
I don't know if this is the right way to set them up, but anyway, it works but I occurred in a behaviour of the key management that looks strange to me.

So, I have set up 2 FSM on the object that I want to move.
One FSM manages the keys W and S, for forward and backward, because of course they will never be pressed together.
The other FSM manages A and D, for turn left and right.

The problem arises, in example, when I press W first, keep it pressed, and press A or D, the W button then results depressed, but it's not.
Being two different FSM, why is it like that?
And how to overcome this limitation, if the thing is correct this way?


Lane:
You may be using the same variables or sending the same event from an A/D FSM on the W/S FSM.

Happens to me nearly every time when I do a controller setup, usually when I'm using a float to vary the speed variable and forget to change them when I copy work from the vertical controls fsm to the horizontal controls fsm.

PolyMad:
I think you hit the target, I'm using the same global variable to act on the wheels.
I'll let you know tomorrow though, too tired now  :o

Navigation

[0] Message Index

Go to full version