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
47
S
17
G
81
Posts: 2,229
Reputation: 48,105

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
57
S
24
G
14
Posts: 773
Reputation: 13,137

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: No registered users and 21 guests