RThurman said:A quick way would be to do the following--In an actor prototype:Timer (every .025 seconds)----When actor receives event: (touch) is: (inside)--------Change Attribute: (self.Rotation) To: vectorToAngle( self.Position.X - game.Mouse.Position.X , self.Position.Y - game.Mouse.Position.Y )
Comments
In an actor prototype:
Timer (every .025 seconds)
----When actor receives event: (touch) is: (inside)
--------Change Attribute: (self.Rotation) To: vectorToAngle( self.Position.X - game.Mouse.Position.X , self.Position.Y - game.Mouse.Position.Y )
Best way to do it is as so:
Have 3 self interger attirbutes. StartRotation, StartAngle, andMyAngle
When actor receives event touch is pressed:
-change attribute StartRotation to: self rotation
-change attribute StartAngle to: vectorToAngle(mouse.position.x-self.position.x,mouse.position.y-self.position.y)
-constrain attribute MyAngle to: vectorToAngle(mouse.position.x-self.position.x,mouse.position.y-self.position.y)
-constrain attribute self.rotation to: startRotation+(MyAngle-StartAngle)
Yes -- that smooths out the initial lurch very nicely!