shooting button

Hipster_Owl_StudiosHipster_Owl_Studios Member, PRO Posts: 214
edited November -1 in Working with GS (Mac)
Hey im trying to figure out how i would make a shooting button so that when the button is touched my actor begins to shoot?

i tried making a game attribute but since im a littile new at this i cant figure how to make it work please help thanks!

Comments

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    this might not be the best way, but here's what I'd do.

    Create an attribute called Shoot.

    Create an actor called Button

    Create an actor called Gun

    In the Button actor, create a rule that says

    When actor receives touch
    change attribute game.Shoot to 1
    otherwise
    change attribute game.Shoot to 0

    On your Gun actor say
    When attribute game.Shoot is 1
    spawn bullet

    that should do what you want. I'm sure someone probably has a way to do with with less 'code' though :)
Sign In or Register to comment.