playMaker

Author Topic: Key pression/depression behaviour  (Read 1965 times)

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Key pression/depression behaviour
« on: March 27, 2013, 02:41:34 PM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Key pression/depression behaviour
« Reply #1 on: March 27, 2013, 04:52:37 PM »
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.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Key pression/depression behaviour
« Reply #2 on: March 27, 2013, 09:21:10 PM »
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