shooting button
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!
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
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