Need help getting a joystick to have 2 different functions.
Hello all,
Right now I have a Joystick that you press and when moving the joystick around it determines which direction the player is shooting in. I want to be able to tap the joystick to cycle through your two weapons each time it is tapped. If I use "when touch is pressed" it will cycle to the weapon but it does it the player is just using the joystick to aim and shoot. I only want the cycle to occur if the player taps the stick. How can I go about determining if the player has taped the joystick or is pressing it down to aim and shoot? Thanks in advance!
Thanks,
killerpenguins
Right now I have a Joystick that you press and when moving the joystick around it determines which direction the player is shooting in. I want to be able to tap the joystick to cycle through your two weapons each time it is tapped. If I use "when touch is pressed" it will cycle to the weapon but it does it the player is just using the joystick to aim and shoot. I only want the cycle to occur if the player taps the stick. How can I go about determining if the player has taped the joystick or is pressing it down to aim and shoot? Thanks in advance!
Thanks,


Best Answer
-
gyroscope I am here.Posts: 6,598
Hi @killerpenguins
Something like the following should work (not tested):
Rule: When touch is pressed
Timer: Every 0.01 seconds ---- Run to Completion unchecked
Change Attribute: game.Timed ----- real attribute to game.Timed + 0.01
Rule: when game.Timed > 0.04
-----moving the joystick around stuff
Otherwise
---Your changing weapon stuff
Rule: When touch is released
Change Attribute game.Timed to 0
----------------------------------------------
http://davidgriffinapps.co.uk/""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Answers
OK; although my suggestion could incorporate your boolean switch names; either way I hope you get it to work.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps