playMaker

Author Topic: How to make hold button shooting[SOLVED]  (Read 2423 times)

QueenM56

  • Junior Playmaker
  • **
  • Posts: 55
How to make hold button shooting[SOLVED]
« 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
« Last Edit: June 11, 2018, 09:37:30 AM by djaydino »

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: How to make hold button shooting
« Reply #1 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.
Available for Playmaker work

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: How to make hold button shooting
« Reply #2 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

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: How to make hold button shooting
« Reply #3 on: June 10, 2018, 09:26:06 AM »
Yeah, forgot about that.
Available for Playmaker work

QueenM56

  • Junior Playmaker
  • **
  • Posts: 55
Re: How to make hold button shooting
« Reply #4 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

QueenM56

  • Junior Playmaker
  • **
  • Posts: 55
Re: How to make hold button shooting
« Reply #5 on: June 10, 2018, 11:03:59 PM »
Hi guys, the 'get key' set bool value works!
Thank you so much!
M