Problem With Actor Dragging With Constrain Attribute

aandiaandi Member Posts: 99
edited November -1 in Working with GS (Mac)
When my actor is dragged the constrain is not working as the actor keeps rotating very fast as it is being dragged. when i say this i mean the triangle is rotating as well as the bar which is meant to be constrained.

my code for the triangle is

constrain attribute game.playerx to self.positionx
constrain attribute game.playery to self.positiony

rule
actor recieves event touch is pressed

constrain attribute self.position.x to game.mouse.position.x
constrain attribute self.position.y to game.mouse.position.y

rule
actor recieves event mouse button is down
constrain attribute game.gamerotatation to self.rotation
constrain attribute self.rotation to vectorToAngle( self.Position.X - game.Mouse.Position.X , self.Position.Y - game.Mouse.Position.Y )

bar
rule
actor receives event mouse button is down

constrain attribute game.gamerotation to self.rotatation
constrain attribute self.rotation to vectorToAngle( self.Position.X - game.Mouse.Position.X , self.Position.Y - game.Mouse.Position.Y )-131

please help guys

Comments

Sign In or Register to comment.