How do I Make My Player follow my touch smooth

Get help using Construct 2

Post » Wed Feb 15, 2017 8:18 pm

Hello need some help for a app.

I have a player that there only shall move the X from left to right.
Right now im using the code
Touch is Touching button - Player - set X to Touch.X
It works fine a the player moves fine from side to side the problem is that, if you just click in a spot its teleport from one place to another and it needs to smoothly move there.

Sorry for my english from denmark Hope for some help.
B
4
Posts: 4
Reputation: 208

Post » Wed Feb 15, 2017 8:24 pm

You can give it a bullet behaviour and have it set angle toward touch.x, you can have it 'move forward' a number of pixels toward touch.x or you can use rex's 'moveto' plugin which allows the player to moveto a touch position.
B
46
S
15
G
73
Posts: 2,026
Reputation: 43,459

Post » Wed Feb 15, 2017 9:25 pm

Just use rex moveto behaviour and set it to move to touch.x and touch.y

Super simple but effective :D

behavior-moveto_t63156?&hilit=rex+moveto
B
52
S
22
G
12
Posts: 728
Reputation: 11,722

Post » Thu Feb 16, 2017 7:53 pm

Thanks alot followed your tip about moveto rexs and Works perfect :)
B
4
Posts: 4
Reputation: 208

Post » Fri Feb 17, 2017 5:14 am

lerp! if you lerp the location it will move around incredibly smooth.
B
28
S
8
G
1
Posts: 226
Reputation: 2,865


Return to How do I....?

Who is online

Users browsing this forum: duke2704, sebrosen and 28 guests