Need help with joystick controls

RocketBrainRocketBrain Member, PRO Posts: 269
edited November -1 in Working with GS (Mac)
i'm trying to make a joystick but keep it from sliding all over the screen but its not working. Can somebody tell me whats wrong? been driving me nuts.
------------
change attrib CenterX = Self.Position.x
change attrib CenterY = Self.Position.y
-----------
When Touch = Pressed
Constrain attrib Self.Position.X = min(( self.CenterX +30), max( game.Touches.Touch 1.X ,( self.CenterX -30))))
Constrain attrib Self.Position.Y = min(( self.CenterY +30), max( game.Touches.Touch 1.Y ,( self.CenterY -30))))

but when i hit play the actor doesnt follow the touch, which i thought it should. wheres the error? i've checked the coding repeatedly and cant see it.

Comments

Sign In or Register to comment.