# Touch to move to position at specific speed

Member, BASIC Posts: 47

Hello,

I've used the Move To behavior to move my actor to a touch input on screen. I can adjust speed in expression editor, not a problem. The touch input is then dragged and the actor is SUPPOSED to move with the drag at the speed specified. That does not happen. I've tried the Constrain Attribute Behavior but with that, the actor jumps to individual touch positions and that is just bad.

I want the actor to drag along with the touch at the specific speed. Can't seem to find a sure shot way of doing this.

Thanks!

• London, UK.Member Posts: 12,822
edited September 2016

Hello,

I've used the Move To behavior to move my actor to a touch input on screen. I can adjust speed in expression editor, not a problem. The touch input is then dragged and the actor is SUPPOSED to move with the drag at the speed specified.

This seems a little confusing - or maybe I don't quite understand the question - if the actor moves with the drag and at the speed specified, then the player must drag the actor at a fixed speed ?

Have I got that all wrong ? I mean, what happens if the player drags the touch point really quickly across the screen, does the actor move with the drag (i.e. stick to the touch point) or does it move at the specified speed (which could be faster or slower than the drag) ?

• London, UK.Member Posts: 12,822
edited September 2016

This works, but I'm not sure about the drag speed issue . . .

• Member, BASIC Posts: 47

@Socks said:
Have I got that all wrong ? I mean, what happens if the player drags the touch point really quickly across the screen, does the actor move with the drag (i.e. stick to the touch point) or does it move at the specified speed (which could be faster or slower than the drag) ?

To clarify, when the very first touch of the game is made, the actor will move at a custom speed towards the point (and not jump to it). The touch that was made will be kept in place .i.e the finger will not be lifted up. The user will drag the same touch input around the screen to move the actor. The actor will follow at custom speed.

At least that is what I want it to do.
What you showed in the image causes the actor to jump at the initial touch, and then if the user mistakenly lifts his/her finger up and touches again, the actor will jump to the location. I don't want the jumps, want a smooth speed.

Hope that helps in clarifying.

• London, UK.Member Posts: 12,822

What you showed in the image causes the actor to jump at the initial touch . . .

Can you share a screenshot of your version of this rule ?

• Member, BASIC Posts: 47

@Socks said:
Can you share a screenshot of your version of this rule ?

• London, UK.Member Posts: 12,822
edited September 2016

What you showed in the image causes the actor to jump at the initial touch, and then if the user mistakenly lifts his/her finger up and touches again, the actor will jump to the location. I don't want the jumps, want a smooth speed.

Your rule is completely different to the one I suggested ?

• Member, BASIC Posts: 47

@Socks said:
Your rule is completely different to the one I suggested.

I used the one you suggested as well. The actor moves to the touch location. But then I have to touch the screen on another location to move the actor again. The drag function doesn't work with this behavior.

• London, UK.Member Posts: 12,822

@Socks said:
Your rule is completely different to the one I suggested.

I used the one you suggested as well.

Can you share a screenshot of your implementation of the rule I suggested ? The rule works fine, you must have made a mistake somewhere ?

• Member, BASIC Posts: 47

@Socks said:
Can you share a screenshot of your implementation of the rule I suggested ? The rule works fine, you must have made a mistake somewhere ?

You were right, I did make a mistake. Copied it as is in your image. Works like a charm! Thanks a lot!

• Member, BASIC Posts: 47

It's behaving a little oddly. If I click and hold in the middle of the screen and move it even slight up or down. the actor moves all the way down or up of the screen. Could this be because I have constrained my actor's X at 40?

• Member, BASIC Posts: 47

• London, UK.Member Posts: 12,822
edited September 2016