playMaker

Author Topic: Problem with Key Down Event  (Read 1717 times)

Dr_h

  • Playmaker Newbie
  • *
  • Posts: 4
Problem with Key Down Event
« on: August 24, 2018, 11:44:39 AM »
Hi,
I just build a simple player controller like in the video . If I just press down and hold down a key for a short time everything works fine and the player is moving in the right direction. In the FSM editor the two states are switched periodicaly like it should be. But if I keep the key pressed down for a long time the movment of the player is no longer smooth and starts to stutter. Sometimes even the key up command is no longer executed if the key is released. In the FSM editor you can watch at first jumps between the two states but after a while it seems both states are highlighted. Is this a performance problem or a problem with the input buffer?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Problem with Key Down Event
« Reply #1 on: August 25, 2018, 12:13:07 AM »
Hi,
Can you show your setup (fsm/state/actions) this?

key down listens to a key that will be pressed down and then send an event to go to the next state where you do your movement.

There is probably a different issue.



Dr_h

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Problem with Key Down Event
« Reply #2 on: August 25, 2018, 03:08:34 AM »
Hi,
thanks for the reply. I use the following states

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Problem with Key Down Event
« Reply #3 on: August 25, 2018, 05:48:35 AM »
Hi.
That looks fine.

Do you have lag on a build also or only in the editor?

Also try to hide windows like playmaker editor,animator,animation also a good thing is to minimize the fsms in the inspector.

But normally the key up should be working...

if you also have this issue in a build then something else is going on.

Dr_h

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Problem with Key Down Event
« Reply #4 on: August 25, 2018, 02:37:22 PM »
Hi,
thanks again for the reply. The issue is in the build too. Funny thing: I assumed that it had something to do with the input/keyboard buffer. So I switched my Cougar gaming keyboard for a normal cherry keyboard and the problem just went away. I don't understand why that is the case, but it works now. Any idea, why the gaming keyboard doesn't work correctly?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Problem with Key Down Event
« Reply #5 on: August 26, 2018, 12:10:32 AM »
Hi.
I believe there is something to set a repeat rate on those keyboards, maybe that's the issue.

When you look to the fsm while playing (with the cougar keyboard) can you see if the highlighted state is jumping back and forth while holding the key?

Maybe the issue is that the key works like a rapid fire which would trigger the key down and key up rapidly even when holding the key.