Best way to Drag OR Rotate by touch but never both.

SingleSparqSingleSparq Member Posts: 1,339
edited November -1 in Working with GS (Mac)
Hey guys, I have an actor in which I drag onto the "game area"(works fine) then if I touch the actor it rotates each tap by 30 degrees(that too works fine) BUT if I want to drag the actor to another position, it will register the touch and rotate the actor again.

I've tried various things with little success, any thoughts to a better way of doing this?

In short:
How do you separate the touch and drag attribute apart from the touch and rotate on the same actor?

Comments

  • PhoticsPhotics Member Posts: 4,172
    Maybe this will work...

    Don't do the rotation until the touch is released. If the actor was moved, don't rotate.
  • SingleSparqSingleSparq Member Posts: 1,339
    I've done combinations of that but maybe not done right, will try again, thanks!
  • hotMagichotMagic Member, PRO Posts: 266
    yeah do it on release, but also remember that if you're dragging to a new position, that release cue is gonna happen at that time that you release, i think.

    I've done some similar types of functionality, and did either a check to see if it moved anywhere, or if a minimum amount of time had passed since you started the touch.
  • jamo777jamo777 Member Posts: 2
    If i want to be able to have my actor rotate following my touch... how would i do that?
    I have done:
    vectorToAngle( self.Position.X - game.Touches.Touch 1.X , self.Position.Y - game.Touches.Touch 1.Y )... This allows me to drag and rotate my actor, but as soon as i touch the actor it jumps 90 degrees and then allows me to drag it. Any help would be awesome. (Sorry for asking on this post, i have tried to start a new post and i got no response)
Sign In or Register to comment.