setting rotation of actor when dragging

I've got an actor that's an arrow. I have behaviors set so when it is dragged, the arrow points in the direction that the user is dragging. Trouble is, when the user stops dragging the actor, the rotation of the arrow flips back to zero. I want it to stay pointing in the correct direction.

Can anyone please fix this code?

Custom Attributes: OldX, OldY, dragging

Timer: Every .25 seconds:
Change Attribute [self.OldX to self.Position.X]
Change Attribute [self.OldY to self.Position.Y]

When self.dragging is true:
Constrain Attribute [self.Rotation to vectorToAngle(game.Mouse.Position.X - self.OldX, game.Mouse.Position.Y - self.OldY) ]

Thanks in advance!

Comments

Sign In or Register to comment.