Sliding Dpad + playClip

Hi folks & folkettes’

My brain’s rattling and i dunno if this is possible, I would appreciate your thoughts.

I have a dpad (left right)
When right is press the character moves right.
Left for left.

I want to be able to press right and slide over to left to move character not have to repress.
The sliding is done however

When the character moves right i use to animate him:

character:playClip("WalkRight")

And etc.

My problem is:
When right is pressed the playClip animation starts but if it goes into the “moved” phase the animation restarts at frame 1 again.

Any thoughts how i can slide my finger between left and right and keep the playClip() continiously playing the animation without restarting until i either release or sliding onto the other button?

 function dpadleft:touch(event)  
 --if event.phase == "began" then -- This causes a requirement the button be press not slide over to.  
 RobotPlayer:playClip ("WalkL");  
 motionx = -speed  
 motiony = 0  
 --end -- joined with the if statement  
  
 if event.phase == "ended" then  
 RobotPlayer:playClip ("Idle");  
 motionx = 0  
 motiony = 0  
 end  
  
 end  

Thanks for your thoughts!
Aplogese if it’s unclear. [import]uid: 91798 topic_id: 16122 reply_id: 316122[/import]

Here’s a suggestion here

Set a variable on which button is pressed, so if you have pressed the right, and you move on the right, it should just ignore and do nothing, but if the move reaches left, then start another animation.

makes sense?

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 16122 reply_id: 59977[/import]