playMaker

Author Topic: Bug in playmaker?  (Read 819 times)

ramones

  • Playmaker Newbie
  • *
  • Posts: 42
    • View Profile
Bug in playmaker?
« on: October 27, 2015, 06:49:10 AM »
Hi,

I have this simple FSM that the only think that does is Get the key down state of a key and print its result after jumping to another state. The behaviour I'm expecting is that the tempBool var become True just for a frame and then false for all the others beside it is still pressed or not. This is not hapenning. After pressing the space key (it doesn't matter if it is released later) the tempBool var is always true. Could anybody look into this issue please?

I have attached pictures of the FSM and state actions. It is very simple.

Note: In the third screenshot you will notice a disabled action. This is an action I have had to use to force the reseting of the boolTemp var. But I expect it to not be needed to make things work if everything were right.

Cheers.
« Last Edit: October 27, 2015, 06:52:06 AM by ramones »

MattBradley

  • Playmaker Newbie
  • *
  • Posts: 20
    • View Profile
Re: Bug in playmaker?
« Reply #1 on: October 27, 2015, 11:38:23 AM »
Hi Ramones,

I think you will want to separate this logic into two FSMs rather than doing it all in one. That'll be giving you some unnecessary issues, especially as you're handling bools.

I've added a few screens to show how I would approach the problem. I always try to break everything down into it's basic behaviours otherwise it starts to get messy when you have bigger projects and complex logic.

FSM 1:






FSM 2:




Hope that helps!

mikejkelley

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Bug in playmaker?
« Reply #2 on: October 28, 2015, 02:56:16 PM »
Hi Ramones,

In the second State Fire you think you are setting the bool to false. What you've actually done is deactivate the Action. Reactivate it by clicking the checkbox next to Set Bool Value.

Also, in the first State get rid of the Next Fame Event and tick Every Frame in Bool Test.

edit: Maybe I've misread your expectations. The way you've set it up is that Get Key Down simply toggles the var to True. It wouldn't automatically reset to False just because the space bar was released.
« Last Edit: October 28, 2015, 03:58:43 PM by mikejkelley »