PlayMaker Help & Tips > PlayMaker Help
[solved] Refire?
Nekoyoubi:
I was trying to work on getting some refire on a weapon that I've got in my (thus far) PlayMaker-only game-in-the-works.
Problem is (and I've tried this many different ways already) that I can't seem to detect or act on an appropriate mouse button state after the initial Down or Up, and the actual Down/Up actions do not seem to want to repeat if nothing's changed.
Basically, what I end up with is: Idle> *Click+Hold* > Fire > Idle > *Still holding* ... *Never going to click again*
I thought, "well, it's just the action of clicking, so of course it's not firing again". So I turned it into a Bool Test. The variable was set appropriately (so I see in debugging), but never fires the event it's wired up to.
Am I misusing the Bool Test? Is there an example already that can articulate weapon refire? Thanks much in advance.
MaDDoX:
You mean even when the flag is tested in BoolTest the state flow is *not* going to the desired state? That's really weird.. Anyways, description is a tad nebulous, a screenshot of your FSM would help (us to help you).
Alex Chouls:
Do you want the weapon to fire repeatedly while the mouse button is pressed?
I would set up the Fire state to transition to itself after a delay (the repeat rate of the weapon).
The Fire state should transition back to Idle on mouse up (or ammo == 0 etc.)
Nekoyoubi:
@Alex : So [Idle + *Click+Hold* > Fire (still held) > Fire (still held) > Fire *Release* > Idle] ?
Alex Chouls:
Exactly. You can then add more states as you develop the game. Once you get the hang of it, a visual FSM lets you quickly build quite complex behavior that is still easy to read and debug.
Navigation
[0] Message Index
[#] Next page
Go to full version