Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: QueenM56 on June 10, 2018, 05:10:38 AM

Title: How to make hold button shooting[SOLVED]
Post by: QueenM56 on June 10, 2018, 05:10:38 AM
Hi all,

I'd like to create a 'hold button shooting' function for my game.
I'm currently using 'get key down' and 'spawn bullets', but it only spawns one bullet each time. Is there any way I can make continuous bullets until the button is up?
Please, anyone can help?

Thanks!
M
Title: Re: How to make hold button shooting
Post by: Fat Pug Studio on June 10, 2018, 06:19:27 AM
Put wait as the last action, and loop the state into itself. Wait time will be your rate of fire basically.
Title: Re: How to make hold button shooting
Post by: terri on June 10, 2018, 07:07:58 AM
Don't use get key down though in this case, I think it won't trigger if you enter the state with it held down?
Use get key followed by a bool compare action
Title: Re: How to make hold button shooting
Post by: Fat Pug Studio on June 10, 2018, 09:26:06 AM
Yeah, forgot about that.
Title: Re: How to make hold button shooting
Post by: QueenM56 on June 10, 2018, 10:16:49 PM
Thanks for the suggestions krmko and Terri.
I did try set bool value after 'get key down', but the problem is it starts to loop in infinite bullet shoot once I set the bool value to true.
I haven't found an effective way to set the bool value back to false.
Does anyone know how to solve it?

Cheers,
M
Title: Re: How to make hold button shooting
Post by: QueenM56 on June 10, 2018, 11:03:59 PM
Hi guys, the 'get key' set bool value works!
Thank you so much!
M