Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Vanyfraise on November 13, 2017, 05:45:48 AM

Title: Fire and alt fire [SOLVED]
Post by: Vanyfraise on November 13, 2017, 05:45:48 AM
Hi guys,

I want to make this danmaku shooting system :


For now, i'm trying this :
- Idle is waiting for "Get Button Down", it stores the result in the bool fireIsPressed.
- IsFiringOnce, take position of owner, create the bullet,
- FireBoolTest is waiting for x secondes and is testing the bool :
   - if true (means player's still pressing "fire1" button), it goes to HOLDFIRE event.
   - if false (means player's not pressing anymore "fire1" button), it return to Idle Start state.

Of course, it's not working, i don't know why but the bool does not set to false when the fire button is release.

I try to make a "shootmanager" in another gameobject in the scene, it set correctly the bool but no result when i test the condition (it do not send to the STOPFIRE event, even if the bool is false).

Do i try with the wrong "get..." action or something else ?

Title: Re: Fire and alt fire
Post by: Vanyfraise on November 13, 2017, 09:58:01 AM
After some investigations,
it seems that my bool test, can't accept the bool to be true.

Title: Re: Fire and alt fire
Post by: djaydino on November 13, 2017, 07:03:50 PM
Hi,
Try a different setup :

State 1 : have a 'mouse down' action. on mouse down go to state 2

State 2 : have a mouse up action and a wait. Connect the mouse up transition to State 3 and wait to State 4.

State 3 : Do single shot

State 4 : Do HoldFire and have a mouse up action when you need to know if released, to go back to State 1.
Title: Re: Fire and alt fire
Post by: Vanyfraise on November 14, 2017, 05:16:02 AM
I'll try this, thank you.

And thank you for your coin magnet video that i just use to make mine :D
Title: Re: Fire and alt fire
Post by: Vanyfraise on November 14, 2017, 08:46:41 AM
Hi,
Try a different setup :

State 1 : have a 'mouse down' action. on mouse down go to state 2

State 2 : have a mouse up action and a wait. Connect the mouse up transition to State 3 and wait to State 4.

State 3 : Do single shot

State 4 : Do HoldFire and have a mouse up action when you need to know if released, to go back to State 1.

It works but i need to repeat the alternate fire as long the button is pressed !

[EDIT] Ok it works ! I put another state making a loop aside . Thank you very much !